1 #ifndef CPPAD_CG_SAVE_FILES_MODEL_LIBRARY_PROCESSOR_INCLUDED
2 #define CPPAD_CG_SAVE_FILES_MODEL_LIBRARY_PROCESSOR_INCLUDED
38 inline void saveSources() {
39 saveSourcesTo(
"cppadcg_sources");
42 inline void saveSourcesTo(
const std::string& sourcesFolder) {
44 auto saveFile = [&](
const std::string& filename,
const std::string& source){
45 std::ofstream sourceFile;
47 sourceFile.open(file.c_str());
54 const std::map<std::string, ModelCSourceGen<Base>*>& models = this->modelLibraryHelper_->getModels();
56 for (
const auto& itm : models) {
57 const std::map<std::string, std::string>& sources = this->getSources(*itm.second);
59 for (
const auto& it : sources) {
60 saveFile(it.first, it.second);
64 for (
const auto& it : this->modelLibraryHelper_->getLibrarySources()) {
65 saveFile(it.first, it.second);
68 for (
const auto& it : this->modelLibraryHelper_->getCustomSources()) {
69 saveFile(it.first, it.second);
74 const std::string& sourcesFolder) {
76 s.saveSourcesTo(sourcesFolder);
std::string createPath(const std::string &baseFolder, const std::string &file)
void createFolder(const std::string &folder)