COOPY » Guide  version 0.6.5
/home/paulfitz/cvs/coopy_scm/coopy/src/libcoopy_core/include/coopy/MergeOutputCsvDiff.h
Go to the documentation of this file.
00001 #ifndef COOPY_MERGEOUTPUTCSVDIFF
00002 #define COOPY_MERGEOUTPUTCSVDIFF
00003 
00004 #include <coopy/MergeOutput.h>
00005 #include <coopy/CsvSheet.h>
00006 
00007 #include <map>
00008 
00009 namespace coopy {
00010   namespace cmp {
00011     class MergeOutputCsvDiff;
00012     class MergeOutputCsvDiffV0p2;
00013     typedef MergeOutputCsvDiffV0p2 MergeOutputCsvDiffStable;
00014     typedef MergeOutputCsvDiff MergeOutputCsvDiffUnstable;
00015   }
00016 }
00017 
00018 class coopy::cmp::MergeOutputCsvDiff : public MergeOutput {
00019 public:
00020   std::string currentSheetName;
00021   std::string pendingSheetName;
00022   coopy::store::CsvSheet result;
00023   std::vector<std::string> ops;
00024   std::vector<std::string> nops;
00025   std::map<std::string,bool> activeColumn;
00026   std::map<std::string,bool> showForSelect;
00027   std::map<std::string,bool> showForDescribe;
00028   std::map<std::string,bool> prevSelect;
00029   std::map<std::string,bool> prevDescribe;
00030   bool constantColumns;
00031   std::vector<std::string> columns;
00032   bool showedColumns;
00033 
00034   MergeOutputCsvDiff();
00035 
00036   virtual bool wantDiff() { return true; }
00037 
00038   virtual bool changeColumn(const OrderChange& change);
00039   virtual bool changeRow(const RowChange& change);
00040 
00041   bool operateRow(const RowChange& change, const char *tag);
00042   bool updateRow(const RowChange& change, const char *tag, bool select, 
00043                  bool update, bool practice);
00044   bool describeRow(const RowChange& change, const char *tag);
00045 
00046   virtual bool mergeStart();
00047   virtual bool mergeClear();
00048   virtual bool mergeDone();
00049 
00050   virtual bool mergeAllDone();
00051 
00052   virtual bool changeName(const NameChange& change);
00053 
00054   const coopy::store::CsvSheet& get() { return result; }
00055 
00056   virtual bool setSheet(const char *name);
00057 
00058   bool clearThroat();
00059 };
00060 
00061 class coopy::cmp::MergeOutputCsvDiffV0p2 : public MergeOutput {
00062 public:
00063   coopy::store::CsvSheet result;
00064 
00065   MergeOutputCsvDiffV0p2();
00066 
00067   virtual bool wantDiff() { return true; }
00068 
00069   virtual bool changeColumn(const OrderChange& change);
00070   virtual bool changeRow(const RowChange& change);
00071 
00072   bool selectRow(const RowChange& change, const char *tag);
00073   bool describeRow(const RowChange& change, const char *tag);
00074 
00075   virtual bool mergeAllDone();
00076 
00077   virtual bool declareNames(const std::vector<std::string>& names, bool final);
00078 
00079   const coopy::store::CsvSheet& get() { return result; }
00080 
00081 };
00082 
00083 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines