COOPY » Guide
version 0.6.5
|
#include <coopy/JsonBook.h>
#include <coopy/FoldedSheet.h>
#include <coopy/Dbg.h>
#include <coopy/FormatSniffer.h>
#include <coopy/FileIO.h>
#include <fstream>
#include <json/json.h>
Go to the source code of this file.
Functions | |
static Json::Value | cellToJson (const SheetCell &cell, const ColumnInfo &info) |
static bool | readPart (Json::Value &rows, FoldedSheet *psheet, SheetSchema *schema) |
static bool | writePart (Json::Value &root2, DataSheet *psheet, bool hasSchema, bool nestSchema) |
static bool | renderJsonBook (Json::Value &root, TextBook *book, const Property &options) |
static Json::Value cellToJson | ( | const SheetCell & | cell, |
const ColumnInfo & | info | ||
) | [static] |
Definition at line 17 of file JsonBook.cpp.
References coopy::store::SheetCell::asInt(), coopy::store::ColumnType::family, coopy::store::ColumnInfo::getColumnType(), and coopy::store::SheetCell::text.
Referenced by writePart().
static bool readPart | ( | Json::Value & | rows, |
FoldedSheet * | psheet, | ||
SheetSchema * | schema | ||
) | [static] |
Definition at line 23 of file JsonBook.cpp.
References coopy::store::TypedSheet< T >::cell(), coopy::fold::FoldedSheet::cellString(), dbg_printf, coopy::store::SheetSchema::getColumnCount(), coopy::store::SheetSchema::getColumnInfo(), coopy::store::ColumnInfo::getName(), coopy::fold::FoldedCell::getOrCreateSheet(), coopy::store::TypedSheet< T >::insertRow(), NULL, and coopy::store::TypedSheet< T >::resize().
Referenced by coopy::store::json::JsonBook::read().
static bool renderJsonBook | ( | Json::Value & | root, |
TextBook * | book, | ||
const Property & | options | ||
) | [static] |
Definition at line 210 of file JsonBook.cpp.
References coopy::store::Value::asInt(), coopy::store::Property::check(), coopy::store::Property::get(), coopy::store::TextBook::getNames(), coopy::store::PolySheet::getSchema(), coopy::store::PolySheet::isValid(), coopy::store::PolySheet::mustHaveSchema(), NULL, coopy::store::TextBook::readSheet(), and writePart().
Referenced by coopy::store::json::JsonBook::render(), and coopy::store::json::JsonBook::write().
static bool writePart | ( | Json::Value & | root2, |
DataSheet * | psheet, | ||
bool | hasSchema, | ||
bool | nestSchema | ||
) | [static] |
Definition at line 149 of file JsonBook.cpp.
References coopy::store::DataSheet::cellString(), coopy::store::DataSheet::cellSummary(), cellToJson(), coopy::store::SheetCell::escaped, coopy::store::SheetSchema::getColumnCount(), coopy::store::SheetSchema::getColumnInfo(), coopy::store::ColumnInfo::getName(), coopy::store::DataSheet::getNestedSheet(), coopy::store::DataSheet::getSchema(), coopy::store::DataSheet::height(), NULL, and coopy::store::DataSheet::width().
Referenced by renderJsonBook().