home Forums # Technical Support How to use .fcl file Reply To: How to use .fcl file

#1258

Hi,

std::string path = "fuzzylite/examples/mamdani/SimpleDimmer.fcl";
std::ifstream reader(path.c_str());
if (not reader.is_open()) {
    throw fl::Exception("[file error] file <" + path + "> could not be opened", FL_AT);
}
std::ostringstream textEngine;
std::string line;
while (std::getline(reader, line)) {
    textEngine << line << std::endl;
}
reader.close();

Engine* engine = FclImporter().fromString(textEngine.str());