Go to the documentation of this file.00001 #ifndef L1GtConfigProducers_L1GtVhdlTemplateFile_h
00002 #define L1GtConfigProducers_L1GtVhdlTemplateFile_h
00003
00021
00022
00023 #include <map>
00024 #include <string>
00025 #include <vector>
00026
00027 class L1GtVhdlTemplateFile
00028 {
00029 private:
00030
00033 bool intern_;
00035 std::vector<std::string> lines_;
00037 std::map<std::string,std::string> parameterMap_;
00038
00039 public:
00040
00042 L1GtVhdlTemplateFile();
00044 L1GtVhdlTemplateFile(const std::string &filename);
00046 L1GtVhdlTemplateFile(const L1GtVhdlTemplateFile& rhs);
00048 ~L1GtVhdlTemplateFile();
00050 static const bool findAndReplaceString(std::string ¶mString, const std::string &searchString, const std::string &replaceString);
00052 bool open(const std::string &fileName, bool internal=false);
00054 bool save(const std::string &fileName);
00055 bool close();
00057 bool substitute(const std::string &searchString, const std::string &replaceString);
00059 bool insert(const std::string &atLine, std::vector<std::string> content);
00061 bool insert(const std::string atLine, L1GtVhdlTemplateFile file);
00063 void print();
00065 void printParameterMap();
00067 std::vector<std::string> returnLines();
00069 std::map<std::string,std::string> returnParameterMap();
00071 std::vector<std::string> getSubstitutionParametersFromTemplate();
00074 bool extractParametersFromString(const std::string &str, std::vector<std::string> ¶meters);
00076 void append(const std::string &str);
00078 void append(const L1GtVhdlTemplateFile& file);
00080 bool removeLineWithContent(const std::string &str);
00082 bool removeEmptyLines();
00084 bool isBlank(const char &chr);
00086 bool split(const std::string ¶m, std::vector<std::string> &result);
00088 void getConditionsFromAlgo(std::string condString, std::vector<std::string> &result);
00090 std::string lines2String();
00092 std::string getInternalParameter(const std::string &indentifier);
00093
00094 };
00095 #endif