Detailed Description
writes and reads jdec files
Definition at line 163 of file reader_jdec.cpp.
Public Member Functions | |
| JDecFileHandler (GCG *gcg, const char *filename) | |
| JDecFileHandler (GCG *gcg, FILE *wfile) | |
| ~JDecFileHandler () | |
| bool | parseElement (AbstractJDecElementParser &elementparser, json_t *element) |
| bool | readJDec (JDecData &data) |
| bool | writeJDec (PARTIALDECOMP *decomp) |
Constructor & Destructor Documentation
◆ JDecFileHandler() [1/2]
| JDecFileHandler::JDecFileHandler | ( | GCG * | gcg, |
| const char * | filename ) |
constructor creating an object ready to read a jdec file
- Parameters
-
gcg GCG data structure filename path of the jdec file to be read
Definition at line 560 of file reader_jdec.cpp.
References GCGgetOrigprob().
◆ JDecFileHandler() [2/2]
| JDecFileHandler::JDecFileHandler | ( | GCG * | gcg, |
| FILE * | wfile ) |
constructor creating an object ready to write a jdec file
- Parameters
-
gcg GCG data structure wfile file pointer used to write the jdec file
Definition at line 574 of file reader_jdec.cpp.
References GCGgetOrigprob().
◆ ~JDecFileHandler()
| JDecFileHandler::~JDecFileHandler | ( | ) |
destructor
Definition at line 588 of file reader_jdec.cpp.
Member Function Documentation
◆ parseElement()
| bool JDecFileHandler::parseElement | ( | AbstractJDecElementParser & | elementparser, |
| json_t * | element ) |
parses a json element using an element parser, returns a bool indicating success/failure
- Parameters
-
elementparser the element parser element pointer to the json element
Definition at line 608 of file reader_jdec.cpp.
References AbstractJDecElementParser::error(), AbstractJDecElementParser::handleKeyValuePair(), and AbstractJDecElementParser::handleValue().
Referenced by JDecBlockElementParser::handleKeyValuePair(), JDecDecompositionElementParser::handleKeyValuePair(), JDecDecompositionElementParser::handleValue(), AbstractJDecDecompositionElementParser::parseDecomposition(), and readJDec().
◆ readJDec()
| bool JDecFileHandler::readJDec | ( | JDecData & | data | ) |
reads a jdec file an stores the information in a data object, returns a bool indicating success/failure
- Note
- must be constructed as reader
- Parameters
-
data JDecData object used to store the read information
Definition at line 646 of file reader_jdec.cpp.
References checkVersion(), parseElement(), and JDecData::version.
Referenced by readJDec().
◆ writeJDec()
| bool JDecFileHandler::writeJDec | ( | gcg::PARTIALDECOMP * | decomp | ) |
writes a partialldec to a jdec file, returns a bool indicating success/failure, returns a bool indicating success/failure
- Note
- must be constructed as writer
- Parameters
-
decomp partialdec that will be written to the jdec file
Definition at line 682 of file reader_jdec.cpp.
References checkJson(), gcg::PARTIALDECOMP::getID(), JDEC_VERSION, and success.
Referenced by writePartialdec().