X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FCDMUtilities.h;h=f807d3262b59df22e837f09a8d71834e28655a02;hb=5a17d994576296f2a5a85f3a01ad5631786a0c56;hp=5430aea2a9c97d770162aeb1ca398783eccf660c;hpb=35dd4d1ddf73a91d308cc49fc394104169936055;p=crea.git diff --git a/lib/creaDevManagerLib/CDMUtilities.h b/lib/creaDevManagerLib/CDMUtilities.h index 5430aea..f807d32 100644 --- a/lib/creaDevManagerLib/CDMUtilities.h +++ b/lib/creaDevManagerLib/CDMUtilities.h @@ -36,6 +36,7 @@ #define CDMUTILITIES_H_ #include +#include #include namespace CDMUtilities @@ -175,6 +176,43 @@ namespace CDMUtilities * @return line stringified. */ std::string stringify(const std::string& line); + + //CMakeLists file handling + /** + * Type definition for the value of a syntax element for CMakeLists files + */ + typedef std::vector cmdValue; + + /** + * Type definition for the type of a syntax element for CMakeLists files + */ + typedef std::string cmdType; + + /** + * Type definition for syntax elements of a CMakeLists file + */ + typedef std::pair syntaxElement; + + /** + * Type definition for describing a CMakeLists file content + */ + typedef std::vector CMLFile; + + /** + * Reads a CMakeLists file and returns the read data. + * @param file_path Full path of the CMakeLists file. + * @return A CMLFile with the contents of the given file. + */ + CMLFile readCMLFile(const std::string& file_path); + + /** + * Writes the given data into specified CMakeLists file. + * @param file_path Full path of the CMakeLists file. + * @param data CMakeLists data. + * @return True if the operation was successful. + */ + bool writeCMLFile(const std::string& file_path, const CMLFile& data); + }; #endif /* CDMUTILITIES_H_ */