COOPY » Guide
version 0.6.5
|
Collection of CSV tables. More...
#include <CsvTextBook.h>
Public Member Functions | |
CsvTextBook (bool compact) | |
virtual std::vector< std::string > | getNames () |
virtual PolySheet | readSheet (const std::string &name) |
bool | clear () |
bool | readCsvs (const char *fname) |
bool | readCsvsData (const char *data, int len) |
std::string | writeCsvsData () |
bool | writeCsvs (const char *fname) |
bool | addSheet (const SheetSchema &schema) |
virtual CsvSheet * | nextSheet (const char *name, bool named) |
virtual bool | namedSheets () const |
virtual int | getSheetCount () |
virtual bool | open (const Property &config) |
virtual PolySheet | readSheetByIndex (int index) |
virtual bool | save (const char *fname, const char *format) |
virtual bool | inplace () const |
virtual bool | canWrite () const |
bool | operator== (const TextBook &alt) const |
bool | equals (const TextBook &alt, const coopy::cmp::CompareFlags &flags) const |
virtual bool | copy (const TextBook &alt, const Property &options) |
bool | fixSchema (const SheetSchema &in, SimpleSheetSchema &out) |
virtual PolySheet | provideSheet (const SheetSchema &schema) |
virtual std::string | desc () const |
virtual TextBook & | tail () |
virtual bool | setPool (Pool *pool) |
virtual Pool * | getPool () const |
bool | applyPool (DataSheet &sheet) |
virtual bool | isValid () const |
virtual bool | writtenToFuture () const |
std::string | toString () |
int | addReference () |
int | removeReference () |
int | getReferenceCount () |
Static Public Member Functions | |
static bool | write (const char *fname, TextBook *book, bool compact, std::string *output=NULL) |
static bool | exists (const char *fname) |
Data Fields | |
std::vector< PolySheet > | sheets |
std::vector< std::string > | names |
std::map< std::string, int > | name2index |
Collection of CSV tables.
Definition at line 24 of file CsvTextBook.h.
coopy::store::CsvTextBook::CsvTextBook | ( | bool | compact | ) | [inline] |
Definition at line 26 of file CsvTextBook.h.
int coopy::store::RefCount::addReference | ( | ) | [inline, inherited] |
Definition at line 30 of file RefCount.h.
Referenced by coopy::store::PolyBook::attach(), coopy::fold::FoldedCell::FoldedCell(), coopy::fold::FoldedCell::getOrCreateSheet(), coopy::store::PolyBook::operator=(), coopy::store::PolyValue::operator=(), coopy::store::PolySheet::operator=(), coopy::fold::FoldedCell::operator=(), coopy::store::PolyBook::PolyBook(), coopy::store::PolySheet::PolySheet(), coopy::store::PolyValue::PolyValue(), coopy::store::PolySheet::setSchema(), and coopy::store::PolyBook::take().
bool CsvTextBook::addSheet | ( | const SheetSchema & | schema | ) | [virtual] |
Reimplemented from coopy::store::TextBook.
Definition at line 175 of file CsvTextBook.cpp.
References COOPY_ASSERT, coopy::store::SimpleSheetSchema::copy(), dbg_printf, coopy::store::SheetSchema::getColumnCount(), coopy::store::SheetSchema::getSheetName(), coopy::store::SheetSchema::hasSheetName(), NULL, coopy::store::CsvSheet::setSheetName(), and coopy::store::CsvSheet::setWidth().
bool coopy::store::TextBook::applyPool | ( | DataSheet & | sheet | ) | [inline, inherited] |
Definition at line 92 of file TextBook.h.
References coopy::store::TextBook::getPool(), and coopy::store::DataSheet::setPool().
Referenced by coopy::store::TextBook::copy().
virtual bool coopy::store::TextBook::canWrite | ( | ) | const [inline, virtual, inherited] |
Reimplemented in coopy::store::mdb::AccessTextBook, coopy::store::PolyBook, and coopy::store::mdb::JackTextBook.
Definition at line 52 of file TextBook.h.
bool coopy::store::CsvTextBook::clear | ( | ) | [inline] |
Definition at line 45 of file CsvTextBook.h.
References name2index, names, and sheets.
Reimplemented in coopy::store::PolyBook.
Definition at line 66 of file TextBook.cpp.
References coopy::store::PolySheet::addedHeader(), coopy::store::TextBook::applyPool(), coopy::store::ColumnType::asSqlite(), coopy::store::Value::asString(), coopy::store::PolySheet::beginTransaction(), coopy_is_verbose(), dbg_printf, coopy::store::PolySheet::deleteData(), coopy::store::DataSheet::desc(), coopy::store::PolySheet::endTransaction(), coopy::store::TextBook::fixSchema(), coopy::store::SheetRow::flush(), coopy::store::PolySheet::forceWidth(), coopy::store::Property::get(), coopy::store::ColumnInfo::getColumnType(), coopy::store::ColumnInfo::getName(), coopy::store::TextBook::getNames(), coopy::store::TextBook::getPool(), coopy::store::PolySheet::getSchema(), coopy::store::PolySheet::hasDimension(), coopy::store::PolySheet::hasExternalColumnNames(), coopy::store::ColumnInfo::hasName(), coopy::store::PolySheet::height(), coopy::store::PolySheet::insertRow(), coopy::store::PolySheet::isValid(), NULL, coopy::store::TextBook::readSheet(), coopy::store::SheetRow::setCell(), coopy::store::SheetSchema::setHeaderHeight(), coopy::store::PolySheet::tail(), coopy::store::SheetSchema::toString(), and coopy::store::PolySheet::width().
Referenced by coopy::store::remotesql::RemoteSqlTextBookFactory::open(), coopy::store::mdb::JackTextBookFactory::open(), coopy::store::gnumeric::GnumericTextBookFactory::open(), coopy::store::mdb::AccessTextBookFactory::open(), coopy::store::sqlite::SqliteTextBookFactory::openNormal(), and coopy::store::sqlite::SqliteTextBookFactory::openTextual().
virtual std::string coopy::store::TextBook::desc | ( | ) | const [inline, virtual, inherited] |
Reimplemented in coopy::store::mdb::AccessTextBook, coopy::store::WrapBook, coopy::store::PolyBook, coopy::store::ShortTextBook, coopy::store::mdb::JackTextBook, coopy::store::socialcalc::SocialCalcTextBook, and coopy::store::sqlite::SqliteTextBook.
Definition at line 71 of file TextBook.h.
Referenced by coopy::store::PolyBook::desc().
bool TextBook::equals | ( | const TextBook & | alt, |
const coopy::cmp::CompareFlags & | flags | ||
) | const [inherited] |
Definition at line 16 of file TextBook.cpp.
References coopy::cmp::CompareFlags::assume_header, coopy::store::PolySheet::cellSummary(), dbg_printf, coopy::store::TextBook::getNames(), coopy::store::PolySheet::getSchema(), coopy::store::PolySheet::height(), coopy::store::PolySheet::hideHeaders(), coopy::store::PolySheet::isValid(), NULL, coopy::store::TextBook::readSheet(), coopy::store::PolySheet::setSchema(), coopy::store::SchemaSniffer::suggestSchema(), coopy::store::SheetCell::toString(), and coopy::store::PolySheet::width().
Referenced by coopy::app::Diff::apply(), and coopy::store::TextBook::operator==().
bool TextBook::exists | ( | const char * | fname | ) | [static, inherited] |
Definition at line 248 of file TextBook.cpp.
Referenced by coopy::store::CsvTextBookFactory::open().
bool TextBook::fixSchema | ( | const SheetSchema & | in, |
SimpleSheetSchema & | out | ||
) | [inherited] |
Definition at line 255 of file TextBook.cpp.
References coopy::store::ColumnType::autoIncrement, coopy::store::ColumnType::autoIncrementSet, coopy::store::SimpleSheetSchema::copy(), coopy::store::ColumnType::foreignKey, coopy::store::ColumnType::foreignKeySet, coopy::store::ColumnType::foreignTable, coopy::store::SimpleSheetSchema::getColumnCount(), coopy::store::SimpleSheetSchema::getColumnInfo(), coopy::store::PoolColumnLink::getColumnName(), coopy::store::ColumnInfo::getName(), coopy::store::SimpleSheetSchema::getSheetName(), coopy::store::PoolColumnLink::getTableName(), coopy::store::PoolColumnLink::isInventor(), coopy::store::PoolColumnLink::isValid(), coopy::store::SimpleSheetSchema::modifyType(), coopy::store::ColumnType::primaryKey, and coopy::store::ColumnType::primaryKeySet.
Referenced by coopy::store::TextBook::copy(), and coopy::cmp::MergeOutputFilter::emitPreamble().
virtual std::vector<std::string> coopy::store::CsvTextBook::getNames | ( | ) | [inline, virtual] |
virtual Pool* coopy::store::TextBook::getPool | ( | ) | const [inline, virtual, inherited] |
Reimplemented in coopy::store::PolyBook.
Definition at line 88 of file TextBook.h.
Referenced by coopy::store::TextBook::applyPool(), coopy::store::TextBook::copy(), and coopy::store::PolyBook::getPool().
int coopy::store::RefCount::getReferenceCount | ( | ) | [inline, inherited] |
Definition at line 40 of file RefCount.h.
virtual int coopy::store::TextBook::getSheetCount | ( | ) | [inline, virtual, inherited] |
Reimplemented in coopy::store::PolyBook.
Definition at line 28 of file TextBook.h.
References coopy::store::TextBook::getNames().
Referenced by coopy::store::Highlighter::apply().
virtual bool coopy::store::TextBook::inplace | ( | ) | const [inline, virtual, inherited] |
Reimplemented in coopy::store::mdb::AccessTextBook, coopy::store::PolyBook, coopy::store::mdb::JackTextBook, coopy::store::remotesql::RemoteSqlTextBook, and coopy::store::sqlite::SqliteTextBook.
Definition at line 48 of file TextBook.h.
Referenced by coopy::store::PolyBook::canWrite(), and coopy::store::PolyBook::inplace().
virtual bool coopy::store::TextBook::isValid | ( | ) | const [inline, virtual, inherited] |
Reimplemented in coopy::store::PolyBook.
Definition at line 96 of file TextBook.h.
Referenced by coopy::cmp::BookCompare::compare().
virtual bool coopy::store::CsvTextBook::namedSheets | ( | ) | const [inline, virtual] |
Reimplemented from coopy::store::TextBook.
Definition at line 71 of file CsvTextBook.h.
CsvSheet * CsvTextBook::nextSheet | ( | const char * | name, |
bool | named | ||
) | [virtual] |
Definition at line 216 of file CsvTextBook.cpp.
References dbg_printf, and NULL.
virtual bool coopy::store::TextBook::open | ( | const Property & | config | ) | [inline, virtual, inherited] |
Reimplemented in coopy::store::mdb::AccessTextBook, coopy::store::json::JsonBook, coopy::store::ShortTextBook, coopy::store::mdb::JackTextBook, coopy::store::remotesql::RemoteSqlTextBook, and coopy::store::socialcalc::SocialCalcTextBook.
Definition at line 32 of file TextBook.h.
Referenced by main().
bool coopy::store::TextBook::operator== | ( | const TextBook & | alt | ) | const [inline, inherited] |
Definition at line 54 of file TextBook.h.
References coopy::store::TextBook::equals().
PolySheet TextBook::provideSheet | ( | const SheetSchema & | schema | ) | [virtual, inherited] |
Reimplemented in coopy::store::PolyBook, coopy::store::ShortTextBook, and coopy::store::socialcalc::SocialCalcTextBook.
Definition at line 233 of file TextBook.cpp.
References dbg_printf, and coopy::store::SheetSchema::getSheetName().
Referenced by coopy::store::PolyBook::provideSheet().
bool CsvTextBook::readCsvs | ( | const char * | fname | ) |
Definition at line 45 of file CsvTextBook.cpp.
References coopy::store::EscapedTypedSheet< T >::cell(), dbg_printf, getRoot(), coopy::store::EscapedTypedSheet< T >::height(), and NULL.
Referenced by coopy::store::CsvTextBookFactory::open().
bool CsvTextBook::readCsvsData | ( | const char * | data, |
int | len | ||
) |
Definition at line 24 of file CsvTextBook.cpp.
Referenced by blob_to_csvs().
virtual PolySheet coopy::store::CsvTextBook::readSheet | ( | const std::string & | name | ) | [inline, virtual] |
Implements coopy::store::TextBook.
Definition at line 38 of file CsvTextBook.h.
References name2index, and sheets.
virtual PolySheet coopy::store::TextBook::readSheetByIndex | ( | int | index | ) | [inline, virtual, inherited] |
Reimplemented in coopy::store::gnumeric::GnumericTextBook.
Definition at line 38 of file TextBook.h.
References coopy::store::TextBook::getNames(), and coopy::store::TextBook::readSheet().
Referenced by coopy::app::Diff::apply(), coopy::store::Highlighter::apply(), coopy::cmp::BookCompare::compare(), csvs_diff(), coopy::fold::FoldTool::fold(), main(), coopy::cmp::BookCompare::resolve(), coopy::cmp::SheetPatcher::setSheet(), coopy::fold::FoldTool::unfold(), coopy::store::socialcalc::SocialCalcTextBook::write(), and write().
int coopy::store::RefCount::removeReference | ( | ) | [inline, inherited] |
Definition at line 35 of file RefCount.h.
Referenced by coopy::store::PolyBook::clear(), coopy::store::PolyValue::clear(), coopy::store::PolySheet::clearSchema(), coopy::store::PolySheet::clearSheet(), and coopy::store::PolyBook::give().
virtual bool coopy::store::TextBook::save | ( | const char * | fname, |
const char * | format | ||
) | [inline, virtual, inherited] |
Reimplemented in coopy::store::gnumeric::GnumericTextBook.
Definition at line 44 of file TextBook.h.
virtual bool coopy::store::TextBook::setPool | ( | Pool * | pool | ) | [inline, virtual, inherited] |
Reimplemented in coopy::store::PolyBook.
Definition at line 83 of file TextBook.h.
Referenced by coopy::cmp::MergeOutputFilter::emitPreamble(), and coopy::store::PolyBook::setPool().
virtual TextBook& coopy::store::TextBook::tail | ( | ) | [inline, virtual, inherited] |
Reimplemented in coopy::store::PolyBook.
Definition at line 79 of file TextBook.h.
Referenced by coopy::cmp::BookCompare::compare(), coopy::store::sqlite::SqliteTextBookFactory::openNormal(), and coopy::store::PolyBook::tail().
std::string coopy::store::TextBook::toString | ( | ) | [inline, inherited] |
Definition at line 106 of file TextBook.h.
References coopy::store::TextBook::getNames(), coopy::store::TextBook::readSheet(), and coopy::store::DataSheet::toString().
bool CsvTextBook::write | ( | const char * | fname, |
TextBook * | book, | ||
bool | compact, | ||
std::string * | output = NULL |
||
) | [static] |
Definition at line 93 of file CsvTextBook.cpp.
References coopy::store::CsvSheet::addField(), coopy::store::CsvSheet::addRecord(), dbg_printf, coopy::store::TextBook::getNames(), getRoot(), coopy::store::TextBook::namedSheets(), NULL, coopy::store::Property::put(), coopy::store::TextBook::readSheetByIndex(), write(), and coopy::store::CsvFile::writeString().
Referenced by coopy::store::CsvTextBookFactory::open(), and writeCsvs().
bool coopy::store::CsvTextBook::writeCsvs | ( | const char * | fname | ) | [inline] |
Definition at line 58 of file CsvTextBook.h.
References write().
std::string CsvTextBook::writeCsvsData | ( | ) |
Definition at line 39 of file CsvTextBook.cpp.
Referenced by blob_show_csvs().
virtual bool coopy::store::TextBook::writtenToFuture | ( | ) | const [inline, virtual, inherited] |
Reimplemented in coopy::store::PolyBook, and coopy::store::sqlite::SqliteTextBook.
Definition at line 100 of file TextBook.h.
Referenced by coopy::store::sqlite::SqliteTextBookFactory::openNormal(), and coopy::store::PolyBook::writtenToFuture().
std::map<std::string,int> coopy::store::CsvTextBook::name2index |
Definition at line 32 of file CsvTextBook.h.
Referenced by clear(), and readSheet().
std::vector<std::string> coopy::store::CsvTextBook::names |
Definition at line 31 of file CsvTextBook.h.
Referenced by clear(), and getNames().
std::vector<PolySheet> coopy::store::CsvTextBook::sheets |
Definition at line 30 of file CsvTextBook.h.
Referenced by clear(), and readSheet().