X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FmodelCDMLibrary.h;h=ae37ec9d2a7ca83d01e80f5377860d17bd16b4e8;hb=157fdd70097efc81cb9bcd3a3b19392b8a144655;hp=4c7fdad33c8ac0de95fbe89b0de83497b7b7bb97;hpb=07de43de26544771a25b4edb25cbbf878bf32de3;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMLibrary.h b/lib/creaDevManagerLib/modelCDMLibrary.h index 4c7fdad..ae37ec9 100644 --- a/lib/creaDevManagerLib/modelCDMLibrary.h +++ b/lib/creaDevManagerLib/modelCDMLibrary.h @@ -37,28 +37,76 @@ #include #include +#include -#include "modelCDMIProjectTreeNode.h" +#include "modelCDMFolder.h" -class modelCDMLibrary : public modelCDMIProjectTreeNode +/** + * Class that represents a library in a Crea project. + */ +class modelCDMLibrary : public modelCDMFolder { public: + /** + * Default Constructor + */ modelCDMLibrary(); + /** + * Constructor of the Library node. + * @param parent Parent node of the library node. + * @param path Full path to the library node. + * @param name Name of the library folder node. + * @param level Project hierarchy level of the library folder node. + */ + modelCDMLibrary(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 2); + /** + * Destructor. + */ ~modelCDMLibrary(); - const std::string& GetName() const; + /** + * Retrieves the name of the Library node. The name of a library can be different than the name of the folder that contains it + * @return Name of the library node. + */ + const std::string& GetNameLibrary() const; + /** + * Renames the library with the given name. + * @param fileName New name of the library node. + * @param result Result message. + * @return True if the operation was successful. + */ + bool SetNameLibrary(const std::string& fileName, std::string*& result); + + /** + * Creates a new folder inside the library folder node. This method not only modifies the project model, but also the system. + * @param name Name of the new folder. + * @param result Result message. + * @return True if the operation was successful. + */ + modelCDMFolder* CreateFolder(const std::string& name, std::string*& result); - bool CreateFolder( - const std::string& name, - std::string*& result, - const std::string& path = "/" - ); - bool OpenCMakeListsFile(std::string*& result); + /** + * Refreshes the structure of the library folder node. Deletes files and folders deleted since last refresh, adds files and folders created since last refresh. + * @param result Result message. + * @return True if the operation was successful. + */ virtual const bool Refresh(std::string*& result); + /** + * Checks the library structure and CMakeLists file to find project structure definition problems before compiling the project. + * @param properties Project properties. + */ + void CheckStructure(std::map& properties); + private: - std::string name; - std::vector libraries; + /** + * Name of the library node. The name of a library can be different than the library folder name. + */ + std::string nameLibrary; + /** + * Folder reference array of folder node inside the library node. + */ + std::vector folders; }; #endif /* MODELCDMLIBRARY_H_ */