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

#include <SqliteSheet.h>

Inheritance diagram for coopy::store::sqlite::SqliteSheet:
coopy::store::DataSheet coopy::cmp::Compare coopy::store::RefCount

Public Member Functions

 SqliteSheet (void *db, const char *name, const char *prefix)
bool connect ()
bool create (const SheetSchema &schema)
virtual ~SqliteSheet ()
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 ColumnRef moveColumn (const ColumnRef &src, const ColumnRef &base)
virtual bool deleteColumn (const ColumnRef &column)
virtual ColumnRef insertColumn (const ColumnRef &base)
virtual ColumnRef insertColumn (const ColumnRef &base, const ColumnInfo &kind)
virtual bool modifyColumn (const ColumnRef &base, const ColumnInfo &kind)
virtual RowRef insertRow (const RowRef &base)
virtual bool deleteRow (const RowRef &src)
virtual ColumnInfo getColumnInfo (int x)
virtual int getColumnCount () const
virtual SheetSchemagetSchema () const
virtual bool applyRowCache (const RowCache &cache, int row, SheetCell *result)
virtual bool deleteData (int offset)
virtual bool hasExternalColumnNames () const
std::string getName () const
virtual bool clearCache ()
 Remove any cached values if used, e.g.
virtual bool isSequential () const
virtual void * getDatabase () const
virtual std::string getDescription () const
virtual coopy::cmp::ComparegetComparisonMethod ()
virtual int compare (coopy::store::DataSheet &pivot, coopy::store::DataSheet &local, coopy::store::DataSheet &remote, coopy::cmp::Patcher &output, const coopy::cmp::CompareFlags &flags)
virtual std::string getRawHash () const
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.
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 deleteRows (const RowRef &first, const RowRef &last)
virtual bool hasDimension () const
virtual bool forceWidth (int width)
virtual bool forceHeight (int height)
virtual Poly< SheetRowinsertRow ()
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< SheetRowinsertRowOrdered (const RowRef &base)
virtual bool applySchema (const SheetSchema &ss)
virtual bool addedHeader ()
virtual std::vector< std::string > getNestedDescription () const
virtual std::string desc () const
virtual std::string getHash (bool cache=false) const
virtual DataSheettail ()
virtual const DataSheettail_const () const
virtual const DataSheetdataTail () 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 ()
int addReference ()
int removeReference ()
int getReferenceCount ()

Static Public Member Functions

static bool isReserved (const std::string &name)
static std::string _quoted (const std::string &x, char ch, bool force)
static std::string _quoted_double (const std::string &x)
static std::string _quoted_single (const std::string &x)
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 21 of file SqliteSheet.h.


Constructor & Destructor Documentation

SqliteSheet::SqliteSheet ( void *  db,
const char *  name,
const char *  prefix 
)

Definition at line 167 of file SqliteSheet.cpp.

References COOPY_MEMORY.

SqliteSheet::~SqliteSheet ( ) [virtual]

Definition at line 529 of file SqliteSheet.cpp.

References NULL.


Member Function Documentation

std::string SqliteSheet::_quoted ( const std::string &  x,
char  ch,
bool  force 
) [static]

Definition at line 214 of file SqliteSheet.cpp.

References quoteSql().

std::string SqliteSheet::_quoted_double ( const std::string &  x) [static]

Definition at line 218 of file SqliteSheet.cpp.

std::string SqliteSheet::_quoted_single ( const std::string &  x) [static]

Definition at line 222 of file SqliteSheet.cpp.

virtual bool coopy::store::DataSheet::addedHeader ( ) [inline, virtual, inherited]
int coopy::store::RefCount::addReference ( ) [inline, inherited]
bool SqliteSheet::applyRowCache ( const RowCache cache,
int  row,
SheetCell result 
) [virtual]
virtual bool coopy::store::DataSheet::applySchema ( const SheetSchema ss) [inline, virtual, inherited]
virtual bool coopy::store::DataSheet::beginTransaction ( ) [inline, virtual, inherited]
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::DataSheet::canResize ( ) [inline, virtual, inherited]
virtual bool coopy::store::DataSheet::canWrite ( ) [inline, virtual, inherited]
bool SqliteSheet::cellString ( int  x,
int  y,
const std::string &  str,
bool  escaped 
) [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 598 of file SqliteSheet.cpp.

References DB, and NULL.

std::string SqliteSheet::cellString ( int  x,
int  y 
) const [virtual]
Returns:
contents of cell in column x, row y, as a string. The value returned by a cell with a NULL value is unspecified.

Implements coopy::store::DataSheet.

Definition at line 539 of file SqliteSheet.cpp.

Referenced by cellString().

std::string SqliteSheet::cellString ( int  x,
int  y,
bool &  escaped 
) const [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 544 of file SqliteSheet.cpp.

References DB, and NULL.

virtual bool coopy::store::sqlite::SqliteSheet::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 38 of file SqliteSheet.h.

References cellString().

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

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 coopy::store::DataSheet::cellString(), coopy::store::SheetCell::escaped, and coopy::store::SheetCell::text.

virtual bool coopy::store::sqlite::SqliteSheet::clearCache ( ) [inline, virtual]

Remove any cached values if used, e.g.

in proxies for remote tables.

Reimplemented from coopy::store::DataSheet.

Definition at line 87 of file SqliteSheet.h.

References coopy::store::SparseSheet< T >::clear().

int SqliteSheet::compare ( coopy::store::DataSheet pivot,
coopy::store::DataSheet local,
coopy::store::DataSheet remote,
coopy::cmp::Patcher output,
const coopy::cmp::CompareFlags flags 
) [virtual]
bool SqliteSheet::connect ( )
bool DataSheet::copyData ( const DataSheet src) [virtual, inherited]
bool SqliteSheet::create ( const SheetSchema schema)
virtual const DataSheet& coopy::store::DataSheet::dataTail ( ) const [inline, virtual, inherited]

Reimplemented in coopy::store::PolySheet.

Definition at line 329 of file DataSheet.h.

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

bool SqliteSheet::deleteColumn ( const ColumnRef column) [virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 675 of file SqliteSheet.cpp.

References DB, coopy::store::ColumnRef::getIndex(), and NULL.

bool SqliteSheet::deleteData ( int  offset) [virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 926 of file SqliteSheet.cpp.

References DB, coopy::store::DataSheet::deleteData(), and NULL.

bool SqliteSheet::deleteRow ( const RowRef src) [virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 819 of file SqliteSheet.cpp.

References DB, coopy::store::RowRef::getIndex(), and NULL.

virtual bool coopy::store::DataSheet::deleteRows ( const RowRef first,
const RowRef last 
) [inline, virtual, inherited]
virtual std::string coopy::store::DataSheet::desc ( ) const [inline, virtual, inherited]
std::string DataSheet::encode ( const SheetStyle style) const [inherited]
std::string DataSheet::encodeCell ( const SheetCell str,
const SheetStyle style 
) [static, inherited]
virtual bool coopy::store::DataSheet::endTransaction ( ) [inline, virtual, inherited]
virtual bool coopy::store::DataSheet::forceHeight ( int  height) [inline, virtual, inherited]

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, inherited]
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::DataSheet::getCellAppearance ( int  x,
int  y 
) [inline, virtual, inherited]
virtual Poly<Appearance> coopy::store::DataSheet::getColAppearance ( int  x) [inline, virtual, inherited]
virtual int coopy::store::sqlite::SqliteSheet::getColumnCount ( ) const [inline, virtual]
virtual ColumnInfo coopy::store::sqlite::SqliteSheet::getColumnInfo ( int  x) [inline, virtual]
virtual coopy::cmp::Compare* coopy::store::sqlite::SqliteSheet::getComparisonMethod ( ) [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 105 of file SqliteSheet.h.

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

Reimplemented from coopy::store::DataSheet.

Definition at line 97 of file SqliteSheet.h.

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

Reimplemented from coopy::store::DataSheet.

Definition at line 101 of file SqliteSheet.h.

std::string DataSheet::getHash ( bool  cache = false) const [virtual, inherited]
SheetSchema * DataSheet::getMeta ( ) const [virtual, inherited]

Reimplemented in coopy::store::PolySheet.

Definition at line 12 of file DataSheet.cpp.

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

std::string coopy::store::sqlite::SqliteSheet::getName ( ) const [inline]

Definition at line 83 of file SqliteSheet.h.

Referenced by coopy::store::sqlite::SqliteSheetSchema::getSheetName().

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

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, inherited]

Reimplemented in coopy::store::PolySheet.

Definition at line 367 of file DataSheet.h.

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

std::string SqliteSheet::getRawHash ( ) const [virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 335 of file SqliteSheet.cpp.

References DB, and NULL.

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, inherited]
SheetSchema * SqliteSheet::getSchema ( ) const [virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 534 of file SqliteSheet.cpp.

virtual bool coopy::store::DataSheet::hasDimension ( ) const [inline, virtual, inherited]
virtual bool coopy::store::sqlite::SqliteSheet::hasExternalColumnNames ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 79 of file SqliteSheet.h.

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

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, inherited]

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::sqlite::SqliteSheet::height ( ) const [inline, virtual]
Returns:
height of table

Implements coopy::store::DataSheet.

Definition at line 32 of file SqliteSheet.h.

ColumnRef SqliteSheet::insertColumn ( const ColumnRef base) [virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 694 of file SqliteSheet.cpp.

ColumnRef SqliteSheet::insertColumn ( const ColumnRef base,
const ColumnInfo kind 
) [virtual]
RowRef SqliteSheet::insertRow ( const RowRef base) [virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 782 of file SqliteSheet.cpp.

References DB, coopy::store::RowRef::getIndex(), and NULL.

Poly< SheetRow > DataSheet::insertRow ( ) [virtual, inherited]
Poly< SheetRow > DataSheet::insertRowOrdered ( const RowRef base) [virtual, inherited]
bool SqliteSheet::isReserved ( const std::string &  name) [static]

Definition at line 193 of file SqliteSheet.cpp.

References NULL, and sql_keywords.

virtual bool coopy::store::sqlite::SqliteSheet::isSequential ( ) const [inline, virtual]

Reimplemented from coopy::store::DataSheet.

Definition at line 93 of file SqliteSheet.h.

bool SqliteSheet::modifyColumn ( const ColumnRef base,
const ColumnInfo kind 
) [virtual]

Implements coopy::store::DataSheet.

Definition at line 698 of file SqliteSheet.cpp.

References coopy::store::ColumnRef::getIndex().

ColumnRef SqliteSheet::moveColumn ( const ColumnRef src,
const ColumnRef base 
) [virtual]
virtual RowRef coopy::store::DataSheet::moveRow ( const RowRef src,
const RowRef base 
) [inline, virtual, inherited]
int coopy::store::RefCount::removeReference ( ) [inline, inherited]
virtual bool coopy::store::DataSheet::resize ( int  w,
int  h 
) [inline, virtual, inherited]
virtual bool coopy::store::DataSheet::rollbackTransaction ( ) [inline, virtual, inherited]
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().

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

Reimplemented in coopy::store::PolySheet.

Definition at line 18 of file DataSheet.cpp.

References NULL.

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

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

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, inherited]

Reimplemented in coopy::store::PolySheet.

Definition at line 321 of file DataSheet.h.

Referenced by compare(), and coopy::store::PolySheet::tail().

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

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, 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::sqlite::SqliteSheet::width ( ) const [inline, virtual]
Returns:
width of table

Implements coopy::store::DataSheet.

Definition at line 31 of file SqliteSheet.h.


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