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

An abstract table. More...

#include <DataSheet.h>

Inheritance diagram for coopy::store::DataSheet:
coopy::store::RefCount coopy::store::EscapedTypedSheet< T > coopy::store::gnumeric::GnumericSheet coopy::store::mdb::AccessSheet coopy::store::mdb::JackSheet coopy::store::PolySheet coopy::store::remotesql::RemoteSqlSheet coopy::store::socialcalc::SocialCalcSheet coopy::store::SparseSheet< T > coopy::store::sqlite::SqliteSheet coopy::store::TypedSheet< T > coopy::store::EscapedTypedSheet< std::string > coopy::store::SparseSheet< float > coopy::store::SparseSheet< int > coopy::store::SparseSheet< std::string > coopy::store::SparseSheet< unsigned char > coopy::store::TypedSheet< float > coopy::store::TypedSheet< FoldedCell > coopy::store::TypedSheet< int > coopy::store::TypedSheet< std::pair< std::string, bool > >

Public Member Functions

 DataSheet ()
virtual ~DataSheet ()
virtual int width () const =0
virtual int height () const =0
virtual std::string cellString (int x, int y) const =0
virtual std::string cellString (int x, int y, bool &escaped) const
virtual SheetCell cellSummary (int x, int y) 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 bool cellSummary (int x, int y, const SheetCell &c)
 sets the contents of cell in column x, row y to a specified value.
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 encode (const SheetStyle &style) const
 Render table as serialized text, using the specified style.
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 SheetSchemagetSchema () const
virtual bool deleteColumn (const ColumnRef &column)
virtual ColumnRef insertColumn (const ColumnRef &base)
virtual ColumnRef insertColumn (const ColumnRef &base, const ColumnInfo &info)=0
virtual bool modifyColumn (const ColumnRef &base, const ColumnInfo &info)=0
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 bool deleteData (int offset=0)
virtual bool hasDimension () const
virtual bool forceWidth (int width)
virtual bool forceHeight (int height)
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 hasExternalColumnNames () const
virtual bool resize (int w, int h)
virtual Poly< SheetRowinsertRow ()
virtual Poly< SheetRowinsertRowOrdered (const RowRef &base)
virtual bool applyRowCache (const RowCache &cache, int row, SheetCell *result)
virtual bool applySchema (const SheetSchema &ss)
virtual bool addedHeader ()
virtual std::string getDescription () const
virtual std::vector< std::string > getNestedDescription () const
virtual std::string desc () const
virtual std::string getHash (bool cache=false) 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)
virtual Poly< AppearancegetCellAppearance (int x, int y)
virtual Poly< AppearancegetRowAppearance (int y)
virtual Poly< AppearancegetColAppearance (int x)
virtual bool hasSheetName () const
virtual bool hasRowOffset () const
virtual bool setPool (Pool *pool)
virtual PoolgetPool () const
virtual void setMeta (SheetSchema *hint)
virtual SheetSchemagetMeta () const
virtual bool beginTransaction ()
virtual bool rollbackTransaction ()
virtual bool endTransaction ()
virtual void * getDatabase () const
virtual coopy::cmp::ComparegetComparisonMethod ()
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

An abstract table.

Definition at line 53 of file DataSheet.h.


Constructor & Destructor Documentation

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

Definition at line 55 of file DataSheet.h.

DataSheet::~DataSheet ( ) [virtual]

Definition at line 8 of file DataSheet.cpp.

References NULL, and setMeta().


Member Function Documentation

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

Reimplemented in coopy::store::PolySheet.

Definition at line 285 of file DataSheet.h.

References coopy::store::SheetSchema::addedHeader(), and getSchema().

Referenced by coopy::store::PolySheet::addedHeader().

int coopy::store::RefCount::addReference ( ) [inline, inherited]
bool DataSheet::applyRowCache ( const RowCache cache,
int  row,
SheetCell result 
) [virtual]
virtual bool coopy::store::DataSheet::applySchema ( const SheetSchema ss) [inline, virtual]
virtual bool coopy::store::DataSheet::beginTransaction ( ) [inline, virtual]
virtual bool coopy::store::DataSheet::canEscape ( ) const [inline, virtual]
Returns:
true iff cells in this table may be NULL

Definition at line 139 of file DataSheet.h.

virtual bool coopy::store::DataSheet::canResize ( ) [inline, virtual]
virtual bool coopy::store::DataSheet::canWrite ( ) [inline, virtual]
virtual std::string coopy::store::DataSheet::cellString ( int  x,
int  y,
bool &  escaped 
) const [inline, virtual]
virtual std::string coopy::store::DataSheet::cellString ( int  x,
int  y 
) const [pure virtual]
virtual bool coopy::store::DataSheet::cellString ( int  x,
int  y,
const std::string &  str 
) [inline, virtual]
virtual bool coopy::store::DataSheet::cellString ( int  x,
int  y,
const std::string &  str,
bool  escaped 
) [inline, virtual]
virtual bool coopy::store::DataSheet::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 in coopy::fold::FoldedSheet, coopy::store::PolySheet, and coopy::store::gnumeric::GnumericSheet.

Definition at line 130 of file DataSheet.h.

References cellString(), coopy::store::SheetCell::escaped, and coopy::store::SheetCell::text.

virtual SheetCell coopy::store::DataSheet::cellSummary ( int  x,
int  y 
) const [inline, virtual]
virtual bool coopy::store::DataSheet::clearCache ( ) [inline, virtual]

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.

bool DataSheet::copyData ( const DataSheet src) [virtual]

Reimplemented in coopy::store::PolySheet.

Definition at line 134 of file DataSheet.cpp.

References canResize(), canWrite(), getCell(), height(), resize(), setCell(), and width().

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

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

Reimplemented in coopy::store::PolySheet.

Definition at line 329 of file DataSheet.h.

Referenced by coopy::store::PolySheet::dataTail(), and coopy::cmp::Patcher::getSheet().

virtual bool coopy::store::DataSheet::deleteColumn ( const ColumnRef column) [inline, virtual]
virtual bool coopy::store::DataSheet::deleteData ( int  offset = 0) [inline, virtual]
virtual bool coopy::store::DataSheet::deleteRow ( const RowRef src) [inline, virtual]
virtual bool coopy::store::DataSheet::deleteRows ( const RowRef first,
const RowRef last 
) [inline, virtual]
virtual std::string coopy::store::DataSheet::desc ( ) const [inline, virtual]
std::string DataSheet::encode ( const SheetStyle style) const
std::string DataSheet::encodeCell ( const SheetCell str,
const SheetStyle style 
) [static]
virtual bool coopy::store::DataSheet::endTransaction ( ) [inline, virtual]
virtual bool coopy::store::DataSheet::forceHeight ( int  height) [inline, virtual]

Reimplemented in coopy::store::PolySheet.

Definition at line 246 of file DataSheet.h.

Referenced by coopy::store::PolySheet::forceHeight().

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

Definition at line 148 of file DataSheet.h.

References cellSummary().

Referenced by copyData().

virtual Poly<Appearance> coopy::store::DataSheet::getCellAppearance ( int  x,
int  y 
) [inline, virtual]
virtual Poly<Appearance> coopy::store::DataSheet::getColAppearance ( int  x) [inline, virtual]
virtual coopy::cmp::Compare* coopy::store::DataSheet::getComparisonMethod ( ) [inline, virtual]
virtual void* coopy::store::DataSheet::getDatabase ( ) const [inline, virtual]
virtual std::string coopy::store::DataSheet::getDescription ( ) const [inline, virtual]
std::string DataSheet::getHash ( bool  cache = false) const [virtual]
SheetSchema * DataSheet::getMeta ( ) const [virtual]

Reimplemented in coopy::store::PolySheet.

Definition at line 12 of file DataSheet.cpp.

Referenced by coopy::store::PolySheet::getMeta(), and coopy::cmp::Patcher::metaHint().

virtual std::vector<std::string> coopy::store::DataSheet::getNestedDescription ( ) const [inline, virtual]

Reimplemented in coopy::store::PolySheet.

Definition at line 296 of file DataSheet.h.

References getDescription().

Referenced by desc(), and coopy::store::PolySheet::getNestedDescription().

virtual DataSheet* coopy::store::DataSheet::getNestedSheet ( int  x,
int  y 
) [inline, virtual]

Reimplemented in coopy::fold::FoldedSheet, and coopy::store::PolySheet.

Definition at line 338 of file DataSheet.h.

Referenced by coopy::store::PolySheet::getNestedSheet(), and writePart().

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

Reimplemented in coopy::store::PolySheet.

Definition at line 367 of file DataSheet.h.

Referenced by coopy::store::PolySheet::getPool().

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

Reimplemented in coopy::store::PolySheet, and coopy::store::sqlite::SqliteSheet.

Definition at line 317 of file DataSheet.h.

Referenced by getHash(), and coopy::store::PolySheet::getRawHash().

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

Definition at line 40 of file RefCount.h.

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

Reimplemented in coopy::store::PolySheet.

Definition at line 358 of file DataSheet.h.

Referenced by coopy::store::PolySheet::hasRowOffset(), and coopy::cmp::Patcher::metaHint().

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

Reimplemented in coopy::store::CsvSheet, and coopy::store::PolySheet.

Definition at line 354 of file DataSheet.h.

Referenced by coopy::store::PolySheet::hasSheetName().

virtual int coopy::store::DataSheet::height ( ) const [pure virtual]
virtual ColumnRef coopy::store::DataSheet::insertColumn ( const ColumnRef base) [inline, virtual]
virtual ColumnRef coopy::store::DataSheet::insertColumn ( const ColumnRef base,
const ColumnInfo info 
) [pure virtual]
Poly< SheetRow > DataSheet::insertRow ( ) [virtual]

Reimplemented in coopy::store::PolySheet.

Definition at line 180 of file DataSheet.cpp.

References COOPY_ASSERT, insertRowOrdered(), and isSequential().

Referenced by applyRowCache(), and insertRowOrdered().

virtual RowRef coopy::store::DataSheet::insertRow ( const RowRef base) [inline, virtual]
Poly< SheetRow > DataSheet::insertRowOrdered ( const RowRef base) [virtual]
virtual bool coopy::store::DataSheet::isSequential ( ) const [inline, virtual]
virtual bool coopy::store::DataSheet::modifyColumn ( const ColumnRef base,
const ColumnInfo info 
) [pure virtual]
virtual ColumnRef coopy::store::DataSheet::moveColumn ( const ColumnRef src,
const ColumnRef base 
) [inline, virtual]
virtual RowRef coopy::store::DataSheet::moveRow ( const RowRef src,
const RowRef base 
) [inline, virtual]
int coopy::store::RefCount::removeReference ( ) [inline, inherited]
virtual bool coopy::store::DataSheet::resize ( int  w,
int  h 
) [inline, virtual]
virtual bool coopy::store::DataSheet::rollbackTransaction ( ) [inline, virtual]
virtual bool coopy::store::DataSheet::setCell ( int  x,
int  y,
const SheetCell c 
) [inline, virtual]

set contents of cell in column x, row y

Definition at line 157 of file DataSheet.h.

References cellSummary().

Referenced by applyRowCache(), and copyData().

void DataSheet::setMeta ( SheetSchema hint) [virtual]

Reimplemented in coopy::store::PolySheet.

Definition at line 18 of file DataSheet.cpp.

References NULL.

Referenced by coopy::store::PolySheet::setMeta(), and ~DataSheet().

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

Reimplemented in coopy::store::PolySheet.

Definition at line 362 of file DataSheet.h.

Referenced by coopy::store::TextBook::applyPool(), and coopy::store::PolySheet::setPool().

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

Reimplemented in coopy::store::PolySheet.

Definition at line 325 of file DataSheet.h.

Referenced by coopy::store::PolySheet::tail_const().

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

Render table as serialized text, using a default style.

Definition at line 173 of file DataSheet.h.

References encode().

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

virtual int coopy::store::DataSheet::width ( ) const [pure virtual]

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