COOPY » Guide
version 0.6.5
|
#include <MergeOutputCsvDiff.h>
Public Member Functions | |
MergeOutputCsvDiff () | |
virtual bool | wantDiff () |
virtual bool | changeColumn (const OrderChange &change) |
virtual bool | changeRow (const RowChange &change) |
bool | operateRow (const RowChange &change, const char *tag) |
bool | updateRow (const RowChange &change, const char *tag, bool select, bool update, bool practice) |
bool | describeRow (const RowChange &change, const char *tag) |
virtual bool | mergeStart () |
virtual bool | mergeClear () |
virtual bool | mergeDone () |
virtual bool | mergeAllDone () |
virtual bool | changeName (const NameChange &change) |
const coopy::store::CsvSheet & | get () |
virtual bool | setSheet (const char *name) |
bool | clearThroat () |
virtual bool | wantLinks () |
virtual bool | changeConfig (const ConfigChange &change) |
virtual bool | changePool (const PoolChange &change) |
virtual bool | declareLink (const LinkDeclare &decl) |
virtual bool | declareNames (const std::vector< std::string > &names, bool isFinal) |
This method is headed toward deprecation in favor of changeName. | |
virtual bool | addSheet (const char *name, const coopy::store::PolySheet &sheet) |
virtual bool | removeSheet (const char *name) |
virtual bool | renameSheet (const char *name0, const char *name1) |
virtual bool | setFlags (const CompareFlags &flags) |
const CompareFlags & | getFlags () const |
CompareFlags & | getMutableFlags () |
virtual bool | addRow (const char *tag, const std::vector< coopy::store::SheetCell > &row, const std::string &blank) |
virtual bool | addRow (const char *tag, const std::vector< std::string > &row, const std::string &blank) |
virtual bool | addHeader (const char *tag, const std::vector< coopy::store::SheetCell > &row, const std::string &blank) |
virtual bool | addHeader (const char *tag, const std::vector< std::string > &row, const std::string &blank) |
virtual bool | stripMarkup () |
virtual void | attachSheet (coopy::store::PolySheet sheet) |
void | attachBook (coopy::store::TextBook &book) |
coopy::store::TextBook * | getBook () |
virtual bool | startOutput (const std::string &output, CompareFlags &flags) |
virtual bool | stopOutput (const std::string &output, CompareFlags &flags) |
virtual bool | needOutputBook () |
virtual bool | outputStartsFromInput () |
void | attachOutputBook (coopy::store::TextBook &book) |
coopy::store::TextBook * | getOutputBook () |
virtual int | getChangeCount () |
virtual void | setConflicted () |
virtual bool | isConflicted () const |
bool | applyPool (const PoolChange &change) |
bool | addPoolsFromFlags (const coopy::store::DataSheet &sheet, bool msg=true) |
bool | addPoolsFromSchema (const coopy::store::DataSheet &sheet, const coopy::store::NameSniffer &sniffer, const std::string &sheetName, bool msg=true) |
virtual coopy::store::PolySheet | getSheet () |
virtual bool | metaHint (const coopy::store::DataSheet &sheet) |
virtual bool | setNames (bool forceSheetChange=false) |
Static Public Member Functions | |
static Patcher * | createByName (const char *name, const char *version=NULL) |
static bool | copyFile (const char *src, const char *dest) |
Data Fields | |
std::string | currentSheetName |
std::string | pendingSheetName |
coopy::store::CsvSheet | result |
std::vector< std::string > | ops |
std::vector< std::string > | nops |
std::map< std::string, bool > | activeColumn |
std::map< std::string, bool > | showForSelect |
std::map< std::string, bool > | showForDescribe |
std::map< std::string, bool > | prevSelect |
std::map< std::string, bool > | prevDescribe |
bool | constantColumns |
std::vector< std::string > | columns |
bool | showedColumns |
Protected Attributes | |
CompareFlags | flags |
FILE * | out |
coopy::store::PolySheet | patch_sheet |
coopy::store::PolySheet | active_sheet |
coopy::store::TextBook * | patch_book |
coopy::store::TextBook * | output_book |
bool | conflicted |
bool | pending |
Definition at line 18 of file MergeOutputCsvDiff.h.
MergeOutputCsvDiff::MergeOutputCsvDiff | ( | ) |
Definition at line 36 of file MergeOutputCsvDiff.cpp.
virtual bool coopy::cmp::Patcher::addHeader | ( | const char * | tag, |
const std::vector< coopy::store::SheetCell > & | row, | ||
const std::string & | blank | ||
) | [inline, virtual, inherited] |
Definition at line 420 of file Patcher.h.
References coopy::cmp::Patcher::addRow().
Referenced by coopy::cmp::Patcher::addHeader(), and coopy::cmp::Merger::merge().
virtual bool coopy::cmp::Patcher::addHeader | ( | const char * | tag, |
const std::vector< std::string > & | row, | ||
const std::string & | blank | ||
) | [inline, virtual, inherited] |
Definition at line 426 of file Patcher.h.
References coopy::cmp::Patcher::addHeader().
bool Patcher::addPoolsFromFlags | ( | const coopy::store::DataSheet & | sheet, |
bool | msg = true |
||
) | [inherited] |
Definition at line 255 of file Patcher.cpp.
References coopy::store::SheetSchema::getColumnCount(), coopy::store::SheetSchema::getColumnInfo(), coopy::store::PoolColumnLink::getColumnName(), coopy::store::ColumnInfo::getName(), coopy::store::PoolColumnLink::getPoolName(), coopy::store::DataSheet::getSchema(), coopy::store::SheetSchema::getSheetName(), coopy::store::PoolColumnLink::getTableName(), coopy::store::PoolColumnLink::isInventor(), coopy::store::PoolColumnLink::isValid(), NULL, coopy::cmp::PoolChange::pool, coopy::cmp::PoolChange::poolName, and coopy::cmp::PoolChange::tableName.
Referenced by coopy::cmp::BookCompare::create(), and coopy::cmp::Merger::merge().
bool Patcher::addPoolsFromSchema | ( | const coopy::store::DataSheet & | sheet, |
const coopy::store::NameSniffer & | sniffer, | ||
const std::string & | sheetName, | ||
bool | msg = true |
||
) | [inherited] |
Definition at line 302 of file Patcher.cpp.
References coopy::store::ColumnType::autoIncrement, coopy::store::Pool::create(), coopy::store::ColumnType::foreignKey, coopy::store::ColumnType::foreignTable, coopy::store::PoolColumnLink::getColumnName(), coopy::store::PoolColumnLink::getPoolName(), coopy::store::PoolColumnLink::getTableName(), coopy::store::PoolColumnLink::isInventor(), coopy::store::PoolColumnLink::isValid(), coopy::store::Pool::lookup(), coopy::cmp::PoolChange::pool, coopy::cmp::CompareFlags::pool, coopy::cmp::PoolChange::poolName, coopy::store::NameSniffer::suggestColumnName(), coopy::store::NameSniffer::suggestColumnType(), coopy::cmp::PoolChange::tableName, and coopy::store::DataSheet::width().
Referenced by coopy::cmp::BookCompare::create().
virtual bool coopy::cmp::Patcher::addRow | ( | const char * | tag, |
const std::vector< coopy::store::SheetCell > & | row, | ||
const std::string & | blank | ||
) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputPatch.
Definition at line 406 of file Patcher.h.
Referenced by coopy::cmp::Patcher::addHeader(), and coopy::cmp::Patcher::addRow().
virtual bool coopy::cmp::Patcher::addRow | ( | const char * | tag, |
const std::vector< std::string > & | row, | ||
const std::string & | blank | ||
) | [inline, virtual, inherited] |
Definition at line 410 of file Patcher.h.
References coopy::cmp::Patcher::addRow().
virtual bool coopy::cmp::Patcher::addSheet | ( | const char * | name, |
const coopy::store::PolySheet & | sheet | ||
) | [inline, virtual, inherited] |
Definition at line 379 of file Patcher.h.
Referenced by coopy::cmp::BookCompare::compare().
bool Patcher::applyPool | ( | const PoolChange & | change | ) | [inherited] |
Definition at line 232 of file Patcher.cpp.
References NULL, coopy::cmp::PoolChange::pool, coopy::cmp::PoolChange::poolName, and coopy::cmp::PoolChange::tableName.
Referenced by coopy::cmp::SheetPatcher::changePool(), coopy::cmp::MergeOutputPool::changePool(), and coopy::cmp::MergeOutputFilter::changePool().
void Patcher::attachBook | ( | coopy::store::TextBook & | book | ) | [inherited] |
Definition at line 156 of file Patcher.cpp.
Referenced by coopy::app::Diff::apply(), csvs_diff(), generateExample(), and WideSheetManager::mergeToLocal().
void coopy::cmp::Patcher::attachOutputBook | ( | coopy::store::TextBook & | book | ) | [inline, inherited] |
Definition at line 466 of file Patcher.h.
References coopy::cmp::Patcher::output_book.
Referenced by csv_merge(), and csvs_diff().
virtual void coopy::cmp::Patcher::attachSheet | ( | coopy::store::PolySheet | sheet | ) | [inline, virtual, inherited] |
Definition at line 442 of file Patcher.h.
References coopy::cmp::Patcher::patch_sheet.
bool MergeOutputCsvDiff::changeColumn | ( | const OrderChange & | change | ) | [virtual] |
Reimplemented from coopy::cmp::Patcher.
Definition at line 82 of file MergeOutputCsvDiff.cpp.
References coopy::cmp::OrderChange::mode, coopy::cmp::OrderChange::namesAfter, coopy::cmp::ORDER_CHANGE_DELETE, coopy::cmp::ORDER_CHANGE_INSERT, coopy::cmp::ORDER_CHANGE_MOVE, and coopy::cmp::ORDER_CHANGE_RENAME.
virtual bool coopy::cmp::Patcher::changeConfig | ( | const ConfigChange & | change | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputFilter, and coopy::cmp::SheetPatcher.
Definition at line 329 of file Patcher.h.
Referenced by coopy::cmp::SheetPatcher::changeConfig(), and coopy::cmp::MergeOutputFilter::changeConfig().
bool MergeOutputCsvDiff::changeName | ( | const NameChange & | change | ) | [virtual] |
Reimplemented from coopy::cmp::Patcher.
Definition at line 335 of file MergeOutputCsvDiff.cpp.
References coopy::cmp::NameChange::constant, coopy::cmp::NameChange::final, and coopy::cmp::NameChange::names.
virtual bool coopy::cmp::Patcher::changePool | ( | const PoolChange & | change | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputFilter, coopy::cmp::MergeOutputPool, coopy::cmp::MergeOutputTdiff, coopy::cmp::MergeOutputVerboseDiff, and coopy::cmp::SheetPatcher.
Definition at line 335 of file Patcher.h.
Referenced by coopy::cmp::SheetPatcher::changePool().
bool MergeOutputCsvDiff::changeRow | ( | const RowChange & | change | ) | [virtual] |
Reimplemented from coopy::cmp::Patcher.
Definition at line 228 of file MergeOutputCsvDiff.cpp.
References coopy::cmp::RowChange::cond, coopy::cmp::RowChange::indexes, coopy::cmp::RowChange::mode, coopy::cmp::RowChange::names, OP_ASSIGN, OP_MATCH, OP_MATCH_ASSIGN, OP_NONE, coopy::cmp::ROW_CHANGE_CONTEXT, coopy::cmp::ROW_CHANGE_DELETE, coopy::cmp::ROW_CHANGE_INSERT, coopy::cmp::ROW_CHANGE_MOVE, coopy::cmp::ROW_CHANGE_UPDATE, and coopy::cmp::RowChange::val.
bool MergeOutputCsvDiff::clearThroat | ( | ) |
Definition at line 367 of file MergeOutputCsvDiff.cpp.
bool Patcher::copyFile | ( | const char * | src, |
const char * | dest | ||
) | [static, inherited] |
Definition at line 130 of file Patcher.cpp.
References NULL.
Patcher * Patcher::createByName | ( | const char * | name, |
const char * | version = NULL |
||
) | [static, inherited] |
Definition at line 54 of file Patcher.cpp.
References NULL.
Referenced by coopy::app::Coopy::setFormat().
virtual bool coopy::cmp::Patcher::declareLink | ( | const LinkDeclare & | decl | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputFilter, coopy::cmp::MergeOutputIndex, coopy::cmp::MergeOutputNovel, and coopy::cmp::SheetPatcher.
Definition at line 337 of file Patcher.h.
Referenced by coopy::cmp::SheetPatcher::declareLink(), coopy::cmp::MergeOutputFilter::declareLink(), and coopy::cmp::Merger::merge().
virtual bool coopy::cmp::Patcher::declareNames | ( | const std::vector< std::string > & | names, |
bool | isFinal | ||
) | [inline, virtual, inherited] |
This method is headed toward deprecation in favor of changeName.
Called with a sequence of column names. It is called twice. First, with final=false, giving an initial sequence. Then, a series of changeColumn() calls may happen, specifying manipulations of the columns. After all changeColumn() calls have happened, this method is called again, with final=true, giving a final sequence of column names.
Reimplemented in coopy::cmp::MergeOutputCsvDiffV0p2, coopy::cmp::MergeOutputHumanDiff, and coopy::cmp::SheetPatcher.
Definition at line 351 of file Patcher.h.
Referenced by coopy::cmp::Patcher::changeName().
bool coopy::cmp::MergeOutputCsvDiff::describeRow | ( | const RowChange & | change, |
const char * | tag | ||
) |
const coopy::store::CsvSheet& coopy::cmp::MergeOutputCsvDiff::get | ( | ) | [inline] |
Definition at line 54 of file MergeOutputCsvDiff.h.
References result.
coopy::store::TextBook* coopy::cmp::Patcher::getBook | ( | ) | [inline, inherited] |
Definition at line 448 of file Patcher.h.
References coopy::cmp::Patcher::patch_book.
virtual int coopy::cmp::Patcher::getChangeCount | ( | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::SheetPatcher.
Definition at line 474 of file Patcher.h.
Referenced by coopy::app::Coopy::getChangeCount().
const CompareFlags& coopy::cmp::Patcher::getFlags | ( | ) | const [inline, inherited] |
Definition at line 394 of file Patcher.h.
References coopy::cmp::Patcher::flags.
Referenced by coopy::cmp::MergeOutputFilter::changePool().
CompareFlags& coopy::cmp::Patcher::getMutableFlags | ( | ) | [inline, inherited] |
Definition at line 398 of file Patcher.h.
References coopy::cmp::Patcher::flags.
coopy::store::TextBook* coopy::cmp::Patcher::getOutputBook | ( | ) | [inline, inherited] |
Definition at line 470 of file Patcher.h.
References coopy::cmp::Patcher::output_book.
coopy::store::PolySheet Patcher::getSheet | ( | ) | [virtual, inherited] |
Definition at line 177 of file Patcher.cpp.
References coopy::store::DataSheet::dataTail(), coopy::store::PolySheet::dataTail(), coopy::store::PolySheet::forbidSchema(), and coopy::store::PolySheet::isValid().
virtual bool coopy::cmp::Patcher::isConflicted | ( | ) | const [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputFilter.
Definition at line 484 of file Patcher.h.
References coopy::cmp::Patcher::conflicted.
Referenced by coopy::cmp::MergeOutputFilter::isConflicted().
bool MergeOutputCsvDiff::mergeAllDone | ( | ) | [virtual] |
Reimplemented from coopy::cmp::Patcher.
Definition at line 74 of file MergeOutputCsvDiff.cpp.
bool MergeOutputCsvDiff::mergeClear | ( | ) | [virtual] |
Definition at line 54 of file MergeOutputCsvDiff.cpp.
bool MergeOutputCsvDiff::mergeDone | ( | ) | [virtual] |
Reimplemented from coopy::cmp::Patcher.
Definition at line 69 of file MergeOutputCsvDiff.cpp.
bool MergeOutputCsvDiff::mergeStart | ( | ) | [virtual] |
Reimplemented from coopy::cmp::Patcher.
Definition at line 39 of file MergeOutputCsvDiff.cpp.
bool Patcher::metaHint | ( | const coopy::store::DataSheet & | sheet | ) | [virtual, inherited] |
Definition at line 193 of file Patcher.cpp.
References coopy::store::SheetSchema::clone(), dbg_printf, coopy::store::DataSheet::getMeta(), coopy::store::DataSheet::hasRowOffset(), and coopy::store::DataSheet::height().
Referenced by coopy::cmp::SheetCompare::compare().
virtual bool coopy::cmp::Patcher::needOutputBook | ( | ) | [inline, virtual, inherited] |
bool MergeOutputCsvDiff::operateRow | ( | const RowChange & | change, |
const char * | tag | ||
) |
Definition at line 137 of file MergeOutputCsvDiff.cpp.
References coopy::cmp::RowChange::names.
virtual bool coopy::cmp::Patcher::outputStartsFromInput | ( | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputEditList, coopy::cmp::MergeOutputNovel, and coopy::cmp::SheetPatcher.
virtual bool coopy::cmp::Patcher::removeSheet | ( | const char * | name | ) | [inline, virtual, inherited] |
Definition at line 384 of file Patcher.h.
Referenced by coopy::cmp::BookCompare::compare().
virtual bool coopy::cmp::Patcher::renameSheet | ( | const char * | name0, |
const char * | name1 | ||
) | [inline, virtual, inherited] |
virtual void coopy::cmp::Patcher::setConflicted | ( | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputFilter, and coopy::cmp::SheetPatcher.
Definition at line 480 of file Patcher.h.
References coopy::cmp::Patcher::conflicted.
Referenced by coopy::cmp::Merger::mergeRow(), coopy::cmp::SheetPatcher::setConflicted(), and coopy::cmp::MergeOutputFilter::setConflicted().
bool Patcher::setFlags | ( | const CompareFlags & | flags | ) | [virtual, inherited] |
Reimplemented in coopy::cmp::SheetPatcher.
Definition at line 150 of file Patcher.cpp.
References coopy::cmp::CompareFlags::out.
Referenced by coopy::app::Diff::apply(), coopy::cmp::BookCompare::compare(), generateExample(), WideSheetManager::mergeToLocal(), coopy::cmp::BookCompare::resolve(), and coopy::cmp::SheetPatcher::setFlags().
virtual bool coopy::cmp::Patcher::setNames | ( | bool | forceSheetChange = false | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::SheetPatcher.
bool MergeOutputCsvDiff::setSheet | ( | const char * | name | ) | [virtual] |
Reimplemented from coopy::cmp::Patcher.
Definition at line 362 of file MergeOutputCsvDiff.cpp.
bool Patcher::startOutput | ( | const std::string & | output, |
CompareFlags & | flags | ||
) | [virtual, inherited] |
Definition at line 104 of file Patcher.cpp.
References NULL, and coopy::cmp::CompareFlags::out.
Referenced by coopy::app::Diff::apply().
bool Patcher::stopOutput | ( | const std::string & | output, |
CompareFlags & | flags | ||
) | [virtual, inherited] |
Definition at line 120 of file Patcher.cpp.
References coopy::cmp::CompareFlags::out.
Referenced by coopy::app::Diff::apply().
virtual bool coopy::cmp::Patcher::stripMarkup | ( | ) | [inline, virtual, inherited] |
Definition at line 436 of file Patcher.h.
Referenced by coopy::cmp::Merger::merge().
bool MergeOutputCsvDiff::updateRow | ( | const RowChange & | change, |
const char * | tag, | ||
bool | select, | ||
bool | update, | ||
bool | practice | ||
) |
Definition at line 184 of file MergeOutputCsvDiff.cpp.
References coopy::cmp::RowChange::cond, coopy::cmp::RowChange::names, and coopy::cmp::RowChange::val.
virtual bool coopy::cmp::MergeOutputCsvDiff::wantDiff | ( | ) | [inline, virtual] |
Reimplemented from coopy::cmp::MergeOutput.
Definition at line 36 of file MergeOutputCsvDiff.h.
virtual bool coopy::cmp::Patcher::wantLinks | ( | ) | [inline, virtual, inherited] |
Reimplemented in coopy::cmp::MergeOutputFilter, coopy::cmp::MergeOutputIndex, coopy::cmp::MergeOutputNovel, and coopy::cmp::SheetPatcher.
Definition at line 327 of file Patcher.h.
Referenced by coopy::cmp::SheetCompare::compare(), coopy::cmp::Merger::merge(), coopy::cmp::Merger::mergeRow(), coopy::cmp::SheetPatcher::wantLinks(), and coopy::cmp::MergeOutputFilter::wantLinks().
coopy::store::PolySheet coopy::cmp::Patcher::active_sheet [protected, inherited] |
std::map<std::string,bool> coopy::cmp::MergeOutputCsvDiff::activeColumn |
Definition at line 25 of file MergeOutputCsvDiff.h.
std::vector<std::string> coopy::cmp::MergeOutputCsvDiff::columns |
Definition at line 31 of file MergeOutputCsvDiff.h.
bool coopy::cmp::Patcher::conflicted [protected, inherited] |
Definition at line 313 of file Patcher.h.
Referenced by coopy::cmp::Patcher::isConflicted(), coopy::cmp::Patcher::Patcher(), and coopy::cmp::Patcher::setConflicted().
Definition at line 30 of file MergeOutputCsvDiff.h.
std::string coopy::cmp::MergeOutputCsvDiff::currentSheetName |
Definition at line 20 of file MergeOutputCsvDiff.h.
CompareFlags coopy::cmp::Patcher::flags [protected, inherited] |
Definition at line 307 of file Patcher.h.
Referenced by coopy::cmp::Patcher::getFlags(), and coopy::cmp::Patcher::getMutableFlags().
std::vector<std::string> coopy::cmp::MergeOutputCsvDiff::nops |
Definition at line 24 of file MergeOutputCsvDiff.h.
std::vector<std::string> coopy::cmp::MergeOutputCsvDiff::ops |
Definition at line 23 of file MergeOutputCsvDiff.h.
FILE* coopy::cmp::Patcher::out [protected, inherited] |
Definition at line 308 of file Patcher.h.
Referenced by coopy::cmp::Patcher::Patcher().
coopy::store::TextBook* coopy::cmp::Patcher::output_book [protected, inherited] |
Definition at line 312 of file Patcher.h.
Referenced by coopy::cmp::Patcher::attachOutputBook(), coopy::cmp::Patcher::getOutputBook(), and coopy::cmp::Patcher::Patcher().
coopy::store::TextBook* coopy::cmp::Patcher::patch_book [protected, inherited] |
Definition at line 311 of file Patcher.h.
Referenced by coopy::cmp::Patcher::getBook(), and coopy::cmp::Patcher::Patcher().
coopy::store::PolySheet coopy::cmp::Patcher::patch_sheet [protected, inherited] |
Definition at line 309 of file Patcher.h.
Referenced by coopy::cmp::Patcher::attachSheet().
bool coopy::cmp::Patcher::pending [protected, inherited] |
Definition at line 314 of file Patcher.h.
Referenced by coopy::cmp::Patcher::Patcher().
std::string coopy::cmp::MergeOutputCsvDiff::pendingSheetName |
Definition at line 21 of file MergeOutputCsvDiff.h.
std::map<std::string,bool> coopy::cmp::MergeOutputCsvDiff::prevDescribe |
Definition at line 29 of file MergeOutputCsvDiff.h.
std::map<std::string,bool> coopy::cmp::MergeOutputCsvDiff::prevSelect |
Definition at line 28 of file MergeOutputCsvDiff.h.
Definition at line 22 of file MergeOutputCsvDiff.h.
Referenced by get().
Definition at line 32 of file MergeOutputCsvDiff.h.
std::map<std::string,bool> coopy::cmp::MergeOutputCsvDiff::showForDescribe |
Definition at line 27 of file MergeOutputCsvDiff.h.
std::map<std::string,bool> coopy::cmp::MergeOutputCsvDiff::showForSelect |
Definition at line 26 of file MergeOutputCsvDiff.h.