]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMProject.h
Feature #1711 CreaDevManager application implementation
[crea.git] / lib / creaDevManagerLib / modelCDMProject.h
index 87d1d3717a7f8db3b65df0f4f1938e7deea562a6..c585ea044fc648a895c629b83457f409f4fd45b7 100644 (file)
 
 #include<iostream>
 #include<vector>
+#include <map>
 
 #include "modelCDMFolder.h"
 #include "modelCDMLib.h"
 #include "modelCDMAppli.h"
 #include "modelCDMPackage.h"
 #include "modelCDMCMakeListsFile.h"
+#include "modelCDMCodeFile.h"
 
 /**
  * Project model class.
@@ -58,7 +60,9 @@ public:
 
   /**
    * Constructor receiving the source path and the build path.
+   * @param parent Parent node of the Project node.
    * @param path The source path.
+   * @param name Name of the project folder.
    * @param buildPath The build path. By default it's an empty string.
    */
   modelCDMProject(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const std::string& buildPath = "");
@@ -68,11 +72,6 @@ public:
    */
   ~modelCDMProject();
 
-  /**
-   * Unimplemented.
-   */
-  void PopulateProject();
-
 
   //Getters
   /**
@@ -144,7 +143,7 @@ public:
 
   //Creations
   /**
-   * Creates a package and sets it as a children of the project. This method creates the package in the hard drive and also in the model.
+   * Creates a package and sets it as a children of the project. This method creates the package in the hard drive and also in the model. The created package is included in the project's CMakeLists file.
    * @param name Name of the package.
    * @param result Result of the operation.
    * @param authors Authors of the operation. If any space is found, it will be replaced by '_'.
@@ -178,12 +177,14 @@ public:
   /**
    * Creates an application and sets it as a children of the appli folder in the project. This method creates the library in the hard drive and also in the model.
    * @param name Application name.
+   * @param type Application type. 0=console application, 1=GUI application (wxWidgets).
    * @param result Result of the operation.
    * @param path Path of the application if not in the application folder. This parameter is not used (for now).
    * @return The result of the creation. If everything goes well it returns true, else it returns false.
    */
   modelCDMIProjectTreeNode* CreateApplication(
       const std::string& name,
+      const int& type,
       std::string*& result,
       const std::string& path = "/appli"
   );
@@ -200,7 +201,7 @@ public:
    */
   modelCDMIProjectTreeNode* CreateBlackBox(
       const std::string& name,
-      const std::string& package = "", //if empty converts into "/bbtk_*projectName*_PKG"
+      const std::string& package = "", //if empty converts into "[projectName]"
       const std::string& authors = "unknown",
       const std::string& authorsEmail = "",
       const std::string& categories = "empty",
@@ -233,6 +234,7 @@ public:
   /**
    * Launches in console the make -clean and make commands to build the project.
    * @param result Result message for building the project.
+   * @param line Line to execute the compilation.
    * @return if any of the commands cannot be executed it return false.
    */
   bool Build(std::string*& result, const std::string& line);
@@ -240,20 +242,75 @@ public:
   /**
    * Launches in console the bbPlugPackage command to connect the project to the .bbtk folder in the hard drive.
    * @param result Result message for connecting the project.
+   * @param folder Folder to make connection with. It must contain the bbtkPackage file
    * @return if the command cannot be executed it return false.
    */
-  bool Connect(std::string*& result);
+  bool Connect(std::string*& result, const std::string& folder);
+
+  /**
+   * Checks the CMakeLists files to see what's going to be compiled and what's not.
+   * @param properties Map containing the project compilation properties.
+   */
+  void CheckStructure(std::map<std::string, bool>& properties);
+
+  /**
+   * Checks if the given package is included in the CMakeLists file.
+   * @param package_name Name of the package to check.
+   * @return True if the package is included, otherwise returns False.
+   */
+  bool IsPackageIncluded(const std::string& package_name);
+
+  /**
+   * Sets the inclusion of the package in the project's CMakeLists file. If the package inclusion already exist in file, then the line is uncommented/commented depending on the requested action. If the package inclusion doesn't exist yet, then it is included if the request is an inclusion.
+   * @param package_name Name of the package to include/exclude.
+   * @param toInclude True if the request is an inclusion, False otherwise.
+   * @return True if the request was processed successfully.
+   */
+  bool SetPackageInclude(const std::string& package_name, const bool& toInclude);
+
+  /**
+   * Checks the project folder's CMakeLists file to check which third party libraries are enabled.
+   * @return A map with the name of the library and if it's included in the CMakeLists file.
+   */
+  std::map<std::string, bool> Get3rdPartyLibraries();
+
+  /**
+   * Sets the 3rd party library inclusion in the CMakeLists file.
+   * @return if the operation was successful.
+   */
+  bool Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude);
 
 
 private:
 
+  /**
+   * Project Name
+   */
   std::string nameProject;
+  /**
+   * Project Version
+   */
   std::string version;
+  /**
+   * Last Project Version Modification Date
+   */
   std::string versionDate;
+  /**
+   * Build Path for compiling the project
+   */
   std::string buildPath;
 
+  /**
+   * lib folder
+   */
   modelCDMLib* lib;
+  /**
+   * appli folder
+   */
   modelCDMAppli* appli;
+  /**
+   * package folders
+   */
   std::vector<modelCDMPackage*> packages;
 
 };