|
soma-io 6.0.6
|
#include <soma-io/writer/pythonwriter.h>

Public Types | |
| typedef void(* | Helper) (const carto::GenericObject &, PythonWriter &w, int indent, bool writeInternals) |
| typedef std::map< std::string, Helper > | HelperSet |
| typedef void(* | CatchFunction) (PythonWriter &, std::exception &, const carto::Object &) |
Public Member Functions | |
| PythonWriter (const std::string &filename, const carto::SyntaxSet &rules=carto::SyntaxSet(), const HelperSet &helpers=HelperSet()) | |
| PythonWriter (const carto::SyntaxSet &rules=carto::SyntaxSet(), const HelperSet &helpers=HelperSet()) | |
| PythonWriter (carto::rc_ptr< DataSource > ds, const carto::SyntaxSet &rules=carto::SyntaxSet(), const HelperSet &helpers=HelperSet()) | |
| PythonWriter takes ownership of the DataSource. | |
| virtual | ~PythonWriter () |
| void | open (const std::string &filename) |
| void | attach (std::ostream &s) |
| attach to an existing (and open) stream | |
| void | attach (carto::rc_ptr< DataSource > ds) |
| void | close () |
| virtual std::string | name () const |
| bool | operator! () const |
| bool | is_open () const |
| carto::rc_ptr< DataSource > | dataSource () |
| const HelperSet & | helpers () const |
| helper functions read basic data type | |
| HelperSet & | helpers () |
| const carto::SyntaxSet & | syntaxes () const |
| carto::SyntaxSet & | syntaxes () |
| void | write (const carto::GenericObject &object, bool writeInternals=false, bool writevariable=true) |
| Writes a generic object to stream. | |
| void | write (const carto::Object &object, bool writeInternals=false, bool writevariable=true) |
| void | write (const carto::GenericObject &object, int indent, const std::string &syntax="", const std::string &semantic="", bool writeInternals=false) |
| Writes an element according to the syntax. | |
| void | write (const carto::Object &object, int indent, const std::string &syntax="", const std::string &semantic="", bool writeInternals=false) |
| Writes an element according to the syntax. | |
| bool | isInternal (const std::string &syntax, const std::string &semantic) |
| void | setSingleLineMode (bool x) |
| bool | singleLine () const |
| void | setCatchFunction (CatchFunction f) |
| if set, the catch function is used instead of throwing the regular exception during writing | |
| char | quoteCharacter () const |
| void | setQuoteCharacter (char q) |
| std::string | noneString () const |
| void | setNoneString (const std::string &none) |
| void | writeString (DataSource &, std::string) |
| utility function | |
Static Public Member Functions | |
| template<typename T> | |
| static void | genericSequenceHelper (const carto::GenericObject &obj, PythonWriter &w, int ind, bool writeInternals) |
Protected Member Functions | |
| void | init (const HelperSet &helpers) |
Protected Attributes | |
| carto::SyntaxSet | _rules |
| carto::rc_ptr< DataSource > | _datasource |
| HelperSet | _helpers |
| bool | _singleLine |
| CatchFunction | _catchFunction |
| char | _quoteChar |
| std::string | _noneString |
Definition at line 56 of file pythonwriter.h.
| typedef void(* soma::PythonWriter::CatchFunction) (PythonWriter &, std::exception &, const carto::Object &) |
Definition at line 62 of file pythonwriter.h.
| typedef void(* soma::PythonWriter::Helper) (const carto::GenericObject &, PythonWriter &w, int indent, bool writeInternals) |
Definition at line 59 of file pythonwriter.h.
| typedef std::map<std::string, Helper> soma::PythonWriter::HelperSet |
Definition at line 61 of file pythonwriter.h.
| soma::PythonWriter::PythonWriter | ( | const std::string & | filename, |
| const carto::SyntaxSet & | rules = carto::SyntaxSet(), | ||
| const HelperSet & | helpers = HelperSet() ) |
References helpers().
Referenced by writeString().
| soma::PythonWriter::PythonWriter | ( | const carto::SyntaxSet & | rules = carto::SyntaxSet(), |
| const HelperSet & | helpers = HelperSet() ) |
References helpers().
| soma::PythonWriter::PythonWriter | ( | carto::rc_ptr< DataSource > | ds, |
| const carto::SyntaxSet & | rules = carto::SyntaxSet(), | ||
| const HelperSet & | helpers = HelperSet() ) |
PythonWriter takes ownership of the DataSource.
References helpers().
|
virtual |
| void soma::PythonWriter::attach | ( | carto::rc_ptr< DataSource > | ds | ) |
| void soma::PythonWriter::attach | ( | std::ostream & | s | ) |
attach to an existing (and open) stream
| void soma::PythonWriter::close | ( | ) |
|
inline |
Definition at line 84 of file pythonwriter.h.
References _datasource.
Referenced by genericSequenceHelper().
|
static |
Definition at line 462 of file pythonwriter_d.h.
References dataSource(), genericSequenceHelper(), carto::IterableInterface::objectIterator(), and soma::DataSource::putch().
Referenced by genericSequenceHelper(), and writeString().
| HelperSet & soma::PythonWriter::helpers | ( | ) |
| const HelperSet & soma::PythonWriter::helpers | ( | ) | const |
helper functions read basic data type
Referenced by init(), PythonWriter(), PythonWriter(), and PythonWriter().
| bool soma::PythonWriter::is_open | ( | ) | const |
| bool soma::PythonWriter::isInternal | ( | const std::string & | syntax, |
| const std::string & | semantic ) |
|
virtual |
|
inline |
Definition at line 118 of file pythonwriter.h.
References _noneString.
| void soma::PythonWriter::open | ( | const std::string & | filename | ) |
| bool soma::PythonWriter::operator! | ( | ) | const |
|
inline |
Definition at line 116 of file pythonwriter.h.
References _quoteChar.
| void soma::PythonWriter::setCatchFunction | ( | CatchFunction | f | ) |
if set, the catch function is used instead of throwing the regular exception during writing
|
inline |
Definition at line 119 of file pythonwriter.h.
References _noneString.
|
inline |
Definition at line 117 of file pythonwriter.h.
References _quoteChar.
|
inline |
Definition at line 111 of file pythonwriter.h.
References _singleLine.
|
inline |
Definition at line 112 of file pythonwriter.h.
References _singleLine.
| carto::SyntaxSet & soma::PythonWriter::syntaxes | ( | ) |
| const carto::SyntaxSet & soma::PythonWriter::syntaxes | ( | ) | const |
| void soma::PythonWriter::write | ( | const carto::GenericObject & | object, |
| bool | writeInternals = false, | ||
| bool | writevariable = true ) |
Writes a generic object to stream.
| void soma::PythonWriter::write | ( | const carto::GenericObject & | object, |
| int | indent, | ||
| const std::string & | syntax = "", | ||
| const std::string & | semantic = "", | ||
| bool | writeInternals = false ) |
Writes an element according to the syntax.
| void soma::PythonWriter::write | ( | const carto::Object & | object, |
| bool | writeInternals = false, | ||
| bool | writevariable = true ) |
| void soma::PythonWriter::write | ( | const carto::Object & | object, |
| int | indent, | ||
| const std::string & | syntax = "", | ||
| const std::string & | semantic = "", | ||
| bool | writeInternals = false ) |
Writes an element according to the syntax.
| void soma::PythonWriter::writeString | ( | DataSource & | , |
| std::string | ) |
utility function
References genericSequenceHelper(), and PythonWriter().
|
protected |
Definition at line 136 of file pythonwriter.h.
|
protected |
Definition at line 133 of file pythonwriter.h.
Referenced by dataSource().
|
protected |
Definition at line 134 of file pythonwriter.h.
|
protected |
Definition at line 138 of file pythonwriter.h.
Referenced by noneString(), and setNoneString().
|
protected |
Definition at line 137 of file pythonwriter.h.
Referenced by quoteCharacter(), and setQuoteCharacter().
|
protected |
Definition at line 132 of file pythonwriter.h.
|
protected |
Definition at line 135 of file pythonwriter.h.
Referenced by setSingleLineMode(), and singleLine().