COOPY » Guide  version 0.6.5
Public Member Functions | Static Public Member Functions
coopy::store::PolySheet Class Reference

#include <PolySheet.h>

Inheritance diagram for coopy::store::PolySheet:
coopy::store::DataSheet coopy::store::RefCount

Public Member Functions

 PolySheet ()
 PolySheet (DataSheet *sheet, bool owned)
 PolySheet (const PolySheet &alt)
const PolySheetoperator= (const PolySheet &alt)
virtual ~PolySheet ()
void setSchema (SheetSchema *schema, bool owned)
virtual SheetSchemagetSchema () const
void clear ()
void clearSheet ()
void clearSchema ()
bool isValid () const
virtual int width () const
virtual int height () const
virtual std::string cellString (int x, int y) const
virtual std::string cellString (int x, int y, bool &escaped) const
virtual bool cellString (int x, int y, const std::string &str)
 sets the contents of cell in column x, row y to a specified string value
virtual bool cellString (int x, int y, const std::string &str, bool escaped)
 sets the contents of cell in column x, row y to a specified string value, or to NULL if "escaped" is set.
virtual SheetCell cellSummary (int x, int y) const
virtual bool cellSummary (int x, int y, const SheetCell &c)
 sets the contents of cell in column x, row y to a specified value.
std::string encode (const SheetStyle &style) const
 Render table as serialized text, using the specified style.
virtual bool deleteColumn (const ColumnRef &column)
virtual ColumnRef insertColumn (const ColumnRef &base)
virtual ColumnRef insertColumn (const ColumnRef &base, const ColumnInfo &info)
virtual bool modifyColumn (const ColumnRef &base, const ColumnInfo &info)
virtual ColumnRef moveColumn (const ColumnRef &src, const ColumnRef &base)
virtual bool deleteRow (const RowRef &src)
virtual bool deleteRows (const RowRef &first, const RowRef &last)
virtual RowRef insertRow (const RowRef &base)
virtual RowRef moveRow (const RowRef &src, const RowRef &base)
virtual bool copyData (const DataSheet &src)
virtual bool canWrite ()
virtual bool canResize ()
virtual bool resize (int w, int h)
virtual Poly< SheetRowinsertRow ()
virtual Poly< SheetRowinsertRowOrdered (const RowRef &base)
virtual bool applySchema (const SheetSchema &ss)
virtual bool applyRowCache (const RowCache &cache, int row, SheetCell *result)
virtual bool deleteData (int start=0)
virtual bool hasDimension () const
virtual bool forceWidth (int width)
virtual bool forceHeight (int height)
virtual bool hasExternalColumnNames () const
virtual std::string getDescription () const
virtual std::vector< std::string > getNestedDescription () const
virtual std::string getHash (bool cache) const
virtual std::string getRawHash () const
virtual DataSheettail ()
virtual const DataSheettail_const () const
virtual const DataSheetdataTail () const
virtual bool isSequential () const
virtual DataSheetgetNestedSheet (int x, int y)
bool setRowOffset (int dh)
virtual bool hasRowOffset () const
bool setRowOffset ()
bool createHeaders ()
bool hideHeaders ()
virtual Poly< AppearancegetCellAppearance (int x, int y)
virtual Poly< AppearancegetRowAppearance (int y)
virtual Poly< AppearancegetColAppearance (int x)
virtual bool hasSheetName () const
virtual bool addedHeader ()
bool mustHaveSchema ()
void forbidSchema ()
virtual bool setPool (Pool *pool)
virtual PoolgetPool () const
virtual void setMeta (SheetSchema *hint)
virtual void setMeta ()
virtual SheetSchemagetMeta () const
virtual bool beginTransaction ()
virtual bool rollbackTransaction ()
virtual bool endTransaction ()
virtual void * getDatabase () const
virtual coopy::cmp::ComparegetComparisonMethod ()
virtual bool canEscape () const
virtual SheetCell getCell (int x, int y) const
virtual bool setCell (int x, int y, const SheetCell &c)
 set contents of cell in column x, row y
std::string toString () const
 Render table as serialized text, using a default style.
virtual bool clearCache ()
 Remove any cached values if used, e.g.
virtual std::string desc () const
int addReference ()
int removeReference ()
int getReferenceCount ()

Static Public Member Functions

static std::string encodeCell (const SheetCell &str, const SheetStyle &style)
 Encode a cell value as text using a specified style.

Detailed Description

Definition at line 13 of file PolySheet.h.


Constructor & Destructor Documentation

coopy::store::PolySheet::PolySheet ( ) [inline]

Definition at line 22 of file PolySheet.h.

coopy::store::PolySheet::PolySheet ( DataSheet sheet,
bool  owned 
) [inline]

Definition at line 31 of file PolySheet.h.

References coopy::store::RefCount::addReference().

coopy::store::PolySheet::PolySheet ( const PolySheet alt) [inline]

Definition at line 41 of file PolySheet.h.

References coopy::store::RefCount::addReference().

virtual coopy::store::PolySheet::~PolySheet ( ) [inline, virtual]

Definition at line 73 of file PolySheet.h.

References clear().


Member Function Documentation

virtual bool coopy::store::PolySheet::addedHeader ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 451 of file PolySheet.h.

References coopy::store::DataSheet::addedHeader(), and COOPY_ASSERT.

Referenced by coopy::store::TextBook::copy().

int coopy::store::RefCount::addReference ( ) [inline, inherited]
virtual bool coopy::store::PolySheet::applyRowCache ( const RowCache cache,
int  row,
SheetCell result 
) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 284 of file PolySheet.h.

References coopy::store::DataSheet::applyRowCache(), and COOPY_ASSERT.

virtual bool coopy::store::PolySheet::applySchema ( const SheetSchema ss) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 279 of file PolySheet.h.

References coopy::store::DataSheet::applySchema(), and COOPY_ASSERT.

virtual bool coopy::store::PolySheet::beginTransaction ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 489 of file PolySheet.h.

References coopy::store::DataSheet::beginTransaction(), and COOPY_ASSERT.

Referenced by coopy::store::TextBook::copy().

virtual bool coopy::store::DataSheet::canEscape ( ) const [inline, virtual, inherited]
Returns:
true iff cells in this table may be NULL

Definition at line 139 of file DataSheet.h.

virtual bool coopy::store::PolySheet::canResize ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 255 of file PolySheet.h.

References coopy::store::DataSheet::canResize(), and COOPY_ASSERT.

virtual bool coopy::store::PolySheet::canWrite ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 250 of file PolySheet.h.

References coopy::store::DataSheet::canWrite(), and COOPY_ASSERT.

virtual std::string coopy::store::PolySheet::cellString ( int  x,
int  y,
bool &  escaped 
) const [inline, virtual]
Returns:
contents of cell in column x, row y, as a string. The "escaped" variable is set to true iff the cell has a NULL value.

Reimplemented from coopy::store::DataSheet.

Definition at line 139 of file PolySheet.h.

References coopy::store::DataSheet::cellString(), and COOPY_ASSERT.

virtual bool coopy::store::PolySheet::cellString ( int  x,
int  y,
const std::string &  str 
) [inline, virtual]

sets the contents of cell in column x, row y to a specified string value

Reimplemented from coopy::store::DataSheet.

Definition at line 144 of file PolySheet.h.

References coopy::store::DataSheet::cellString(), and COOPY_ASSERT.

virtual bool coopy::store::PolySheet::cellString ( int  x,
int  y,
const std::string &  str,
bool  escaped 
) [inline, virtual]

sets the contents of cell in column x, row y to a specified string value, or to NULL if "escaped" is set.

Reimplemented from coopy::store::DataSheet.

Definition at line 149 of file PolySheet.h.

References coopy::store::DataSheet::cellString(), and COOPY_ASSERT.

virtual std::string coopy::store::PolySheet::cellString ( int  x,
int  y 
) const [inline, virtual]
virtual SheetCell coopy::store::PolySheet::cellSummary ( int  x,
int  y 
) const [inline, virtual]
virtual bool coopy::store::PolySheet::cellSummary ( int  x,
int  y,
const SheetCell c 
) [inline, virtual]

sets the contents of cell in column x, row y to a specified value.

Reimplemented from coopy::store::DataSheet.

Definition at line 159 of file PolySheet.h.

References coopy::store::DataSheet::cellSummary(), and COOPY_ASSERT.

void coopy::store::PolySheet::clear ( ) [inline]

Definition at line 92 of file PolySheet.h.

References clearSchema(), and clearSheet().

Referenced by operator=(), coopy::cmp::MergeOutputRowOps::setSheet(), and ~PolySheet().

virtual bool coopy::store::DataSheet::clearCache ( ) [inline, virtual, inherited]

Remove any cached values if used, e.g.

in proxies for remote tables.

Reimplemented in coopy::store::remotesql::RemoteSqlSheet, and coopy::store::sqlite::SqliteSheet.

Definition at line 191 of file DataSheet.h.

void coopy::store::PolySheet::clearSchema ( ) [inline]

Definition at line 109 of file PolySheet.h.

References coopy::store::RefCount::removeReference().

Referenced by clear(), and setSchema().

void coopy::store::PolySheet::clearSheet ( ) [inline]

Definition at line 98 of file PolySheet.h.

References coopy::store::RefCount::removeReference().

Referenced by clear().

virtual bool coopy::store::PolySheet::copyData ( const DataSheet src) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 245 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::copyData().

bool coopy::store::PolySheet::createHeaders ( ) [inline]
virtual const DataSheet& coopy::store::PolySheet::dataTail ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 361 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::dataTail().

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

virtual bool coopy::store::PolySheet::deleteColumn ( const ColumnRef column) [inline, virtual]
virtual bool coopy::store::PolySheet::deleteData ( int  start = 0) [inline, virtual]
virtual bool coopy::store::PolySheet::deleteRow ( const RowRef src) [inline, virtual]
virtual bool coopy::store::PolySheet::deleteRows ( const RowRef first,
const RowRef last 
) [inline, virtual]
virtual std::string coopy::store::DataSheet::desc ( ) const [inline, virtual, inherited]
std::string coopy::store::PolySheet::encode ( const SheetStyle style) const [inline]

Render table as serialized text, using the specified style.

Reimplemented from coopy::store::DataSheet.

Definition at line 164 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::encode().

std::string DataSheet::encodeCell ( const SheetCell str,
const SheetStyle style 
) [static, inherited]
virtual bool coopy::store::PolySheet::endTransaction ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 499 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::endTransaction().

Referenced by coopy::store::TextBook::copy().

void coopy::store::PolySheet::forbidSchema ( ) [inline]

Definition at line 458 of file PolySheet.h.

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

virtual bool coopy::store::PolySheet::forceHeight ( int  height) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 304 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::forceHeight().

virtual bool coopy::store::PolySheet::forceWidth ( int  width) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 299 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::forceWidth().

Referenced by coopy::store::TextBook::copy().

virtual SheetCell coopy::store::DataSheet::getCell ( int  x,
int  y 
) const [inline, virtual, inherited]
Returns:
contents of cell in column x, row y

Definition at line 148 of file DataSheet.h.

References coopy::store::DataSheet::cellSummary().

Referenced by coopy::store::DataSheet::copyData().

virtual Poly<Appearance> coopy::store::PolySheet::getCellAppearance ( int  x,
int  y 
) [inline, virtual]
virtual Poly<Appearance> coopy::store::PolySheet::getColAppearance ( int  x) [inline, virtual]
virtual coopy::cmp::Compare* coopy::store::PolySheet::getComparisonMethod ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 509 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::getComparisonMethod().

virtual void* coopy::store::PolySheet::getDatabase ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 504 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::getDatabase().

virtual std::string coopy::store::PolySheet::getDescription ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 316 of file PolySheet.h.

Referenced by getNestedDescription().

virtual std::string coopy::store::PolySheet::getHash ( bool  cache) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 328 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::getHash().

virtual SheetSchema* coopy::store::PolySheet::getMeta ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 484 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::getMeta().

virtual std::vector<std::string> coopy::store::PolySheet::getNestedDescription ( ) const [inline, virtual]
virtual DataSheet* coopy::store::PolySheet::getNestedSheet ( int  x,
int  y 
) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 371 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::getNestedSheet().

virtual Pool* coopy::store::PolySheet::getPool ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 467 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::getPool().

virtual std::string coopy::store::PolySheet::getRawHash ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 337 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::getRawHash().

int coopy::store::RefCount::getReferenceCount ( ) [inline, inherited]

Definition at line 40 of file RefCount.h.

virtual Poly<Appearance> coopy::store::PolySheet::getRowAppearance ( int  y) [inline, virtual]
virtual SheetSchema* coopy::store::PolySheet::getSchema ( ) const [inline, virtual]
virtual bool coopy::store::PolySheet::hasDimension ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 294 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::hasDimension().

Referenced by coopy::store::TextBook::copy().

virtual bool coopy::store::PolySheet::hasExternalColumnNames ( ) const [inline, virtual]
virtual bool coopy::store::PolySheet::hasRowOffset ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 381 of file PolySheet.h.

References coopy::store::DataSheet::hasRowOffset().

virtual bool coopy::store::PolySheet::hasSheetName ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 446 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::hasSheetName().

virtual int coopy::store::PolySheet::height ( ) const [inline, virtual]
bool coopy::store::PolySheet::hideHeaders ( ) [inline]
virtual ColumnRef coopy::store::PolySheet::insertColumn ( const ColumnRef base) [inline, virtual]
ColumnRef PolySheet::insertColumn ( const ColumnRef base,
const ColumnInfo info 
) [virtual]
virtual RowRef coopy::store::PolySheet::insertRow ( const RowRef base) [inline, virtual]
virtual Poly<SheetRow> coopy::store::PolySheet::insertRow ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 265 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::insertRow().

Referenced by createHeaders().

virtual Poly<SheetRow> coopy::store::PolySheet::insertRowOrdered ( const RowRef base) [inline, virtual]
virtual bool coopy::store::PolySheet::isSequential ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 366 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::isSequential().

Referenced by coopy::cmp::SheetPatcher::changeRow().

bool coopy::store::PolySheet::isValid ( ) const [inline]
bool PolySheet::modifyColumn ( const ColumnRef base,
const ColumnInfo info 
) [virtual]
virtual ColumnRef coopy::store::PolySheet::moveColumn ( const ColumnRef src,
const ColumnRef base 
) [inline, virtual]
virtual RowRef coopy::store::PolySheet::moveRow ( const RowRef src,
const RowRef base 
) [inline, virtual]
bool PolySheet::mustHaveSchema ( )
const PolySheet& coopy::store::PolySheet::operator= ( const PolySheet alt) [inline]

Definition at line 56 of file PolySheet.h.

References coopy::store::RefCount::addReference(), and clear().

int coopy::store::RefCount::removeReference ( ) [inline, inherited]
virtual bool coopy::store::PolySheet::resize ( int  w,
int  h 
) [inline, virtual]
virtual bool coopy::store::PolySheet::rollbackTransaction ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 494 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::rollbackTransaction().

virtual bool coopy::store::DataSheet::setCell ( int  x,
int  y,
const SheetCell c 
) [inline, virtual, inherited]

set contents of cell in column x, row y

Definition at line 157 of file DataSheet.h.

References coopy::store::DataSheet::cellSummary().

Referenced by coopy::store::DataSheet::applyRowCache(), and coopy::store::DataSheet::copyData().

virtual void coopy::store::PolySheet::setMeta ( SheetSchema hint) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 472 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::setMeta().

Referenced by coopy::cmp::SheetCompare::compare().

virtual void coopy::store::PolySheet::setMeta ( ) [inline, virtual]

Definition at line 477 of file PolySheet.h.

References coopy::store::SheetSchema::clone(), COOPY_ASSERT, and getSchema().

virtual bool coopy::store::PolySheet::setPool ( Pool pool) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 462 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::setPool().

bool coopy::store::PolySheet::setRowOffset ( int  dh) [inline]

Definition at line 376 of file PolySheet.h.

bool coopy::store::PolySheet::setRowOffset ( ) [inline]
void coopy::store::PolySheet::setSchema ( SheetSchema schema,
bool  owned 
) [inline]
virtual DataSheet& coopy::store::PolySheet::tail ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 345 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::tail().

Referenced by coopy::store::TextBook::copy().

virtual const DataSheet& coopy::store::PolySheet::tail_const ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 353 of file PolySheet.h.

References COOPY_ASSERT, and coopy::store::DataSheet::tail_const().

Referenced by coopy::cmp::SheetPatcher::setNames().

std::string coopy::store::DataSheet::toString ( ) const [inline, inherited]

Render table as serialized text, using a default style.

Definition at line 173 of file DataSheet.h.

References coopy::store::DataSheet::encode().

Referenced by coopy::cmp::SheetPatcher::changeColumn(), main(), coopy::store::TextBook::toString(), and coopy::store::socialcalc::SocialCalcTextBook::write().

virtual int coopy::store::PolySheet::width ( ) const [inline, virtual]

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