00001
00002
00003
00004
00005
00006
00014 #ifndef DICFILE_H
00015 #define DICFILE_H
00016
00017
00018 #include <string>
00019 #include <iostream>
00020
00021 #include "GenString.h"
00022 #include "ISTable.h"
00023 #include "CifFile.h"
00024
00025
00036 class DicFile : public CifFile
00037 {
00038 public:
00039 using CifFile::Write;
00040
00072 DicFile(const eFileMode fileMode, const std::string& objFileName,
00073 const bool verbose = false, const Char::eCompareType
00074 caseSense = Char::eCASE_SENSITIVE,
00075 const unsigned int maxLineLength = STD_CIF_LINE_LENGTH,
00076 const std::string& nullValue = CifString::UnknownValue);
00077
00103 DicFile(const bool verbose = false, const Char::eCompareType
00104 caseSense = Char::eCASE_SENSITIVE,
00105 const unsigned int maxLineLength = STD_CIF_LINE_LENGTH,
00106 const std::string& nullValue = CifString::UnknownValue);
00107
00121 ~DicFile();
00122
00137 void WriteItemAliases(const std::string& fileName);
00138
00139
00144 ISTable* GetFormatTable();
00145
00150 int WriteFormatted(const std::string& cifFileName, ISTable* formatP = NULL);
00151
00156 int WriteFormatted(const std::string& cifFileName, TableFile* ddl,
00157 ISTable* formatP = NULL);
00158
00163 void Compress(CifFile* ddl);
00164
00165 CifFile* GetRefFile();
00166
00167 protected:
00168 ISTable* _formatP;
00169
00170 int WriteFormatted(std::ostream& cifo, ISTable* formatP);
00171 int WriteFormatted(std::ostream& cifo, TableFile* ddl, ISTable* formatP);
00172
00173 void WriteItemAliases(std::ostream& cifo);
00174
00175 private:
00176 void AddRefRow(ISTable& table, const char* first, const char* second,
00177 const char* third);
00178 };
00179
00180 #endif