COOPY » Guide  version 0.6.5
Public Member Functions | Static Public Member Functions | Protected Attributes
coopy::cmp::SheetPatcher Class Reference

#include <SheetPatcher.h>

Inheritance diagram for coopy::cmp::SheetPatcher:
coopy::cmp::Patcher

Public Member Functions

 SheetPatcher (bool descriptive=false, bool forReview=false, bool forMerge=false)
virtual ~SheetPatcher ()
virtual bool setNames (bool forceSheetChange=false)
void clearNames ()
void showSummary (Patcher *chain, bool chainOwned=true)
int getChangeCount ()
virtual bool changeName (const NameChange &change)
virtual bool changeConfig (const ConfigChange &change)
virtual bool setFlags (const CompareFlags &flags)
virtual bool changeColumn (const OrderChange &change)
virtual bool changeRow (const RowChange &change)
virtual bool declareNames (const std::vector< std::string > &names, bool final)
 This method is headed toward deprecation in favor of changeName.
virtual bool changePool (const PoolChange &change)
virtual bool setSheet (const char *name)
virtual bool mergeStart ()
virtual bool mergeDone ()
virtual bool mergeAllDone ()
virtual void setConflicted ()
virtual bool wantLinks ()
virtual bool declareLink (const LinkDeclare &decl)
virtual bool outputStartsFromInput ()
virtual bool needOutputBook ()
bool markChanges (const RowChange &change, int r, int width, std::vector< int > &active_val, std::vector< coopy::store::SheetCell > &val, std::vector< coopy::store::SheetCell > &cval, std::vector< coopy::store::SheetCell > &pval)
bool handleConflicts ()
bool updateSheet ()
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)
const CompareFlagsgetFlags () const
CompareFlagsgetMutableFlags ()
virtual bool wantDiff ()
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::TextBookgetBook ()
virtual bool startOutput (const std::string &output, CompareFlags &flags)
virtual bool stopOutput (const std::string &output, CompareFlags &flags)
void attachOutputBook (coopy::store::TextBook &book)
coopy::store::TextBookgetOutputBook ()
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)

Static Public Member Functions

static SheetPatchercreateForApply ()
static SheetPatchercreateForMerge ()
static SheetPatchercreateForDescription ()
static SheetPatchercreateForReview ()
static PatchercreateByName (const char *name, const char *version=NULL)
static bool copyFile (const char *src, const char *dest)

Protected Attributes

CompareFlags flags
FILE * out
coopy::store::PolySheet patch_sheet
coopy::store::PolySheet active_sheet
coopy::store::TextBookpatch_book
coopy::store::TextBookoutput_book
bool conflicted
bool pending

Detailed Description

Definition at line 21 of file SheetPatcher.h.


Constructor & Destructor Documentation

coopy::cmp::SheetPatcher::SheetPatcher ( bool  descriptive = false,
bool  forReview = false,
bool  forMerge = false 
) [inline]
virtual coopy::cmp::SheetPatcher::~SheetPatcher ( ) [inline, virtual]

Definition at line 114 of file SheetPatcher.h.

References clearNames().


Member Function Documentation

virtual bool coopy::cmp::Patcher::addHeader ( const char *  tag,
const std::vector< coopy::store::SheetCell > &  row,
const std::string &  blank 
) [inline, virtual, inherited]
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]
bool Patcher::addPoolsFromSchema ( const coopy::store::DataSheet sheet,
const coopy::store::NameSniffer sniffer,
const std::string &  sheetName,
bool  msg = true 
) [inherited]
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]
void Patcher::attachBook ( coopy::store::TextBook book) [inherited]
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 SheetPatcher::changeColumn ( const OrderChange change) [virtual]
virtual bool coopy::cmp::SheetPatcher::changeConfig ( const ConfigChange change) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 147 of file SheetPatcher.h.

References coopy::cmp::Patcher::changeConfig().

bool SheetPatcher::changeName ( const NameChange change) [virtual]
virtual bool coopy::cmp::SheetPatcher::changePool ( const PoolChange change) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 162 of file SheetPatcher.h.

References coopy::cmp::Patcher::applyPool(), and coopy::cmp::Patcher::changePool().

bool SheetPatcher::changeRow ( const RowChange change) [virtual]
void coopy::cmp::SheetPatcher::clearNames ( ) [inline]

Definition at line 127 of file SheetPatcher.h.

Referenced by ~SheetPatcher().

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().

static SheetPatcher* coopy::cmp::SheetPatcher::createForApply ( ) [inline, static]

Definition at line 98 of file SheetPatcher.h.

References SheetPatcher().

static SheetPatcher* coopy::cmp::SheetPatcher::createForDescription ( ) [inline, static]

Definition at line 106 of file SheetPatcher.h.

References SheetPatcher().

static SheetPatcher* coopy::cmp::SheetPatcher::createForMerge ( ) [inline, static]

Definition at line 102 of file SheetPatcher.h.

References SheetPatcher().

static SheetPatcher* coopy::cmp::SheetPatcher::createForReview ( ) [inline, static]

Definition at line 110 of file SheetPatcher.h.

References SheetPatcher().

virtual bool coopy::cmp::SheetPatcher::declareLink ( const LinkDeclare decl) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 187 of file SheetPatcher.h.

References coopy::cmp::Patcher::declareLink().

bool SheetPatcher::declareNames ( const std::vector< std::string > &  names,
bool  isFinal 
) [virtual]

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 from coopy::cmp::Patcher.

Definition at line 1013 of file SheetPatcher.cpp.

References coopy::store::PolySheet::isValid(), and coopy::store::PolySheet::width().

coopy::store::TextBook* coopy::cmp::Patcher::getBook ( ) [inline, inherited]

Definition at line 448 of file Patcher.h.

References coopy::cmp::Patcher::patch_book.

int coopy::cmp::SheetPatcher::getChangeCount ( ) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 141 of file SheetPatcher.h.

Referenced by WideSheetManager::mergeToLocal().

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]
bool SheetPatcher::handleConflicts ( )
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 SheetPatcher::markChanges ( const RowChange change,
int  r,
int  width,
std::vector< int > &  active_val,
std::vector< coopy::store::SheetCell > &  val,
std::vector< coopy::store::SheetCell > &  cval,
std::vector< coopy::store::SheetCell > &  pval 
)
bool SheetPatcher::mergeAllDone ( ) [virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 1135 of file SheetPatcher.cpp.

References dbg_printf.

bool SheetPatcher::mergeDone ( ) [virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 1142 of file SheetPatcher.cpp.

References coopy::cmp::RowUnit::change, dbg_printf, and coopy::cmp::RowUnit::sheet_name.

bool SheetPatcher::mergeStart ( ) [virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 1121 of file SheetPatcher.cpp.

bool Patcher::metaHint ( const coopy::store::DataSheet sheet) [virtual, inherited]
virtual bool coopy::cmp::SheetPatcher::needOutputBook ( ) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 196 of file SheetPatcher.h.

virtual bool coopy::cmp::SheetPatcher::outputStartsFromInput ( ) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 192 of file SheetPatcher.h.

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]

Definition at line 388 of file Patcher.h.

virtual void coopy::cmp::SheetPatcher::setConflicted ( ) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 177 of file SheetPatcher.h.

References coopy::cmp::Patcher::setConflicted().

virtual bool coopy::cmp::SheetPatcher::setFlags ( const CompareFlags flags) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 153 of file SheetPatcher.h.

References coopy::cmp::Patcher::setFlags().

Referenced by generateExample().

bool SheetPatcher::setNames ( bool  forceSheetChange = false) [virtual]
bool SheetPatcher::setSheet ( const char *  name) [virtual]
void coopy::cmp::SheetPatcher::showSummary ( Patcher chain,
bool  chainOwned = true 
) [inline]

Definition at line 135 of file SheetPatcher.h.

Referenced by coopy::app::Diff::apply(), and WideSheetManager::mergeToLocal().

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 SheetPatcher::updateSheet ( )
virtual bool coopy::cmp::Patcher::wantDiff ( ) [inline, virtual, inherited]
virtual bool coopy::cmp::SheetPatcher::wantLinks ( ) [inline, virtual]

Reimplemented from coopy::cmp::Patcher.

Definition at line 182 of file SheetPatcher.h.

References coopy::cmp::Patcher::wantLinks().


Field Documentation

Definition at line 310 of file Patcher.h.

bool coopy::cmp::Patcher::conflicted [protected, inherited]
CompareFlags coopy::cmp::Patcher::flags [protected, inherited]
FILE* coopy::cmp::Patcher::out [protected, inherited]

Definition at line 308 of file Patcher.h.

Referenced by coopy::cmp::Patcher::Patcher().

Definition at line 311 of file Patcher.h.

Referenced by coopy::cmp::Patcher::getBook(), and coopy::cmp::Patcher::Patcher().

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().


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines