1 #ifndef SIMANIO_DOCUMENT_H
2 #define SIMANIO_DOCUMENT_H
7 ///! Kinds of automatic actions, accessible for SIMAN file
8 enum AutomaticProcessing {
13 ///! Possible states of the SIMAN file
18 ///! Action document data
20 std::string url; ///< document url in SIMAN
21 bool result; ///< if true, document is result, the source otherwise
22 AutomaticProcessing proc; ///< processing kind
23 FileState state; ///< state of the document
24 int id; ///< identifier of the file
28 * \brief Class for storage and store CFG file document information.
30 class SimanIO_Document {
31 std::string myName; ///< name of the document
32 typedef std::list<SimanIO_File> DocumentFiles;
33 DocumentFiles myFiles; ///< files of the document
36 * Creates the empty, default document.
41 * Defines the document name.
42 * \param theName name of the document
44 void SetName(const char* theName);
47 * Returns the name of the document.
49 const char* Name() const;
52 * Appends the file to this document.
53 * \param isResult if it is true, the document is resulting document, if false - the input document for the activity
54 * \param theURL path to the file
55 * \param theProc automatic processing kind
56 * \param theState file state
58 void AddFile(const bool isResult, const char* theURL,
59 const AutomaticProcessing theProc, const FileState theState);
62 * Appends the file to this document.
63 * \param theFile file with all fields filled
65 void AddFile(const SimanIO_File& theFile);
68 * Returns stored file or empty file.
69 * \param theId identifier of the file
70 * \returns reference to the file, located in the document
72 const SimanIO_File& File(const int theId) const;
74 //! Iterator for activity documents browsing
76 DocumentFiles::iterator myIter; ///< iterator by the file of the document
77 DocumentFiles::const_iterator myEnd; ///< end iteration indicator
79 ///! Launches the iterator
80 FilesIterator(/*const*/ SimanIO_Document& theDocument);
81 ///! Iterates to the next file of the document.
83 ///! Returns tru if the current file exists.
85 ///! Returns true if the current file is resulting document.
86 const bool IsResult();
87 ///! Returns the current file URL.
89 ///! Set the new URL of the file.
90 void SetURL(const char* theURL);
91 ///! Returns the processing kind
92 const AutomaticProcessing GetProcessing();
93 ///! Returns the file state
94 const FileState GetState();
95 ///! Returns the file Id