CController::CController() { load_documents(ORDER); for (int type = ORDER; type < QUANTITY_TYPES; type++) { saved[type] = true; } }
//возврвщаем список документов выбранного типа QList<CDocument*> CController::get_documents(DocumentType type) { if (type < QUANTITY_TYPES) { if (documents[type].isEmpty())//если документы не загружены, то загружаем их { load_documents(type); } return documents[type]; } QList<CDocument*> empty_list; return empty_list; }
int main(int argc, char *argv[]) { int rv = OK; if (argc != 2) { printf("ERROR: incorrect number of arguments\n"); return ERR_ARG_NUM; } // yaml_version(); rv = load_documents(argv[1]); if (rv) { printf("ERROR: %d", rv); } return rv; }