NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CObjectOStreamJson Class Reference

Search Toolkit Book for CObjectOStreamJson

CObjectOStreamJson –. More...

#include <serial/objostrjson.hpp>

+ Inheritance diagram for CObjectOStreamJson:
+ Collaboration diagram for CObjectOStreamJson:

Public Types

enum  EBinaryDataFormat {
  eDefault, eArray_Bool, eArray_01, eArray_Uint,
  eString_Hex, eString_01, eString_01B, eString_Base64
}
 formatting of binary data ('OCTET STRING', 'hexBinary', 'base64Binary') More...
 
- Public Types inherited from CObjectOStream
enum  EFailFlags {
  fNoError = 0, eNoError = fNoError, fWriteError = 1 << 1, eWriteError = fWriteError,
  fOverflow = 1 << 3, eOverflow = fOverflow, fInvalidData = 1 << 4, eInvalidData = fInvalidData,
  fIllegalCall = 1 << 5, eIllegalCall = fIllegalCall, fFail = 1 << 6, eFail = fFail,
  fNotOpen = 1 << 7, eNotOpen = fNotOpen, fNotImplemented = 1 << 8, eNotImplemented = fNotImplemented,
  fUnassigned = 1 << 9, eUnassigned = fUnassigned
}
 Fail flags. More...
 
enum  EDelayBufferParsing { eDelayBufferPolicyNotSet, eDelayBufferPolicyAlwaysParse, eDelayBufferPolicyNeverParse }
 DelayBuffer parsing policy. More...
 
enum  EFlags {
  fFlagNone = 0, eFlagNone = fFlagNone, fFlagAllowNonAsciiChars = 1 << 0, eFlagAllowNonAsciiChars = fFlagAllowNonAsciiChars,
  fFlagNoAutoFlush = 1 << 1
}
 
enum  ESpecialCaseWrite { eWriteAsNormal = 0, eWriteAsDefault = 1, eWriteAsNil = 2, eWriteAsBigInt = 3 }
 
typedef int TFailFlags
 
typedef int TFlags
 
- Public Types inherited from CObjectStack
typedef CObjectStackFrame TFrame
 
typedef TFrame::EFrameType EFrameType
 

Public Member Functions

 CObjectOStreamJson (CNcbiOstream &out, bool deleteOut)
 Constructor. More...
 
 CObjectOStreamJson (CNcbiOstream &out, EOwnership deleteOut)
 Constructor. More...
 
virtual ~CObjectOStreamJson (void)
 Destructor. More...
 
void SetDefaultStringEncoding (EEncoding enc)
 Set default encoding of 'string' objects. More...
 
EEncoding GetDefaultStringEncoding (void) const
 Get default encoding of 'string' objects. More...
 
EBinaryDataFormat GetBinaryDataFormat (void) const
 Get formatting of binary data. More...
 
void SetBinaryDataFormat (EBinaryDataFormat fmt)
 Set formatting of binary data. More...
 
virtual string GetPosition (void) const
 Get current stream position as string. More...
 
void SetJsonpMode (const string &function_name)
 Set JSONP mode JSONP prefix will become "function_name(" JSONP suffix will become ");". More...
 
void GetJsonpPadding (string *prefix, string *suffix) const
 Get JSONP padding (prefix and suffix) More...
 
virtual void WriteFileHeader (TTypeInfo type)
 
virtual void EndOfWrite (void)
 
- Public Member Functions inherited from CObjectOStream
virtual ~CObjectOStream (void)
 Destructor. More...
 
ESerialDataFormat GetDataFormat (void) const
 Get data format. More...
 
void SetVerifyData (ESerialVerifyData verify)
 Set up output data verification for this particular stream. More...
 
ESerialVerifyData GetVerifyData (void) const
 Get output data verification parameter. More...
 
EFixNonPrint FixNonPrint (EFixNonPrint how)
 
void EnforceWritingDefaultValues (bool enforce=true)
 
bool IsWritingDefaultValuesEnforced () const
 
void SetUseIndentation (bool set)
 Set up indentation usage in text streams. More...
 
bool GetUseIndentation (void) const
 Get indentation usage in text streams. More...
 
void SetUseEol (bool set)
 Set up end-of-line symbol usage in text streams. More...
 
bool GetUseEol (void) const
 Get end-of-line symbol usage in text streams. More...
 
void SetWriteNamedIntegersByValue (bool set)
 Set up writing named integers (in ANS.1 sense) by value only. More...
 
bool GetWriteNamedIntegersByValue (void) const
 Get writing named integers by value parameter. More...
 
string GetSeparator (void) const
 Get separator. More...
 
void SetSeparator (const string sep)
 Set separator. More...
 
bool GetAutoSeparator (void)
 Get separator auto-output paramater. More...
 
void SetAutoSeparator (bool value)
 Set separator auto-output paramater. More...
 
virtual void SetFormattingFlags (TSerial_Format_Flags flags)
 Set output formatting flags. More...
 
bool fail (void) const
 Check if any of fail flags is set. More...
 
TFailFlags GetFailFlags (void) const
 Get fail flags. More...
 
TFailFlags SetFailFlagsNoError (TFailFlags flags)
 Set fail flags, but do not ERR_POST any messages. More...
 
TFailFlags SetFailFlags (TFailFlags flags, const char *message)
 Set fail flags. More...
 
TFailFlags ClearFailFlags (TFailFlags flags)
 Reset fail flags. More...
 
bool InGoodState (void)
 Check fail flags and also the state of output stream. More...
 
void SetCanceledCallback (const ICanceled *callback)
 Set cancellation check callback. More...
 
CNcbiStreampos GetStreamOffset (void) const
 
CNcbiStreampos GetStreamPos (void) const
 Get the current stream position. More...
 
virtual string GetStackTrace (void) const
 Get current stack trace as string. More...
 
void SetPathWriteObjectHook (const string &path, CWriteObjectHook *hook)
 
void SetPathWriteMemberHook (const string &path, CWriteClassMemberHook *hook)
 
void SetPathWriteVariantHook (const string &path, CWriteChoiceVariantHook *hook)
 
void SetDelayBufferParsingPolicy (EDelayBufferParsing policy)
 
EDelayBufferParsing GetDelayBufferParsingPolicy (void) const
 
bool ShouldParseDelayBuffer (void) const
 
void FlushBuffer (void)
 
void Flush (void)
 
void DefaultFlush (void)
 
void Write (const CConstObjectInfo &object)
 
void Write (TConstObjectPtr object, TTypeInfo type)
 
void Write (TConstObjectPtr object, const CTypeRef &type)
 
void WriteObject (const CConstObjectInfo &object)
 
void WriteObject (TConstObjectPtr object, TTypeInfo typeInfo)
 
void CopyObject (TTypeInfo objectType, CObjectStreamCopier &copier)
 
void WriteSeparateObject (const CConstObjectInfo &object)
 
void WriteExternalObject (TConstObjectPtr object, TTypeInfo typeInfo)
 
void WriteClassMember (const CConstObjectInfoMI &member)
 
void WriteChoiceVariant (const CConstObjectInfoCV &member)
 
CObjectOStreamoperator<< (CObjectOStream &(*mod)(CObjectOStream &os))
 
void WriteStd (const bool &data)
 
void WriteStd (const char &data)
 
void WriteStd (const signed char &data)
 
void WriteStd (const unsigned char &data)
 
void WriteStd (const short &data)
 
void WriteStd (const unsigned short &data)
 
void WriteStd (const int &data)
 
void WriteStd (const unsigned int &data)
 
void WriteStd (const long &data)
 
void WriteStd (const unsigned long &data)
 
void WriteStd (const Int8 &data)
 
void WriteStd (const Uint8 &data)
 
void WriteStd (const float &data)
 
void WriteStd (const double &data)
 
void WriteStd (const string &data)
 
void WriteStd (const char *const data)
 
void WriteStd (char *const data)
 
void WriteStd (const CBitString &data)
 
virtual bool Write (CByteSource &source)
 
void Write (const char *data, size_t size)
 
void Close (void)
 
void ResetLocalHooks (void)
 
void HandleEOF (CEofException &)
 
void ThrowError1 (const CDiagCompileInfo &diag_info, TFailFlags fail, const char *message, CException *exc=0)
 
void ThrowError1 (const CDiagCompileInfo &diag_info, TFailFlags fail, const string &message, CException *exc=0)
 
void Unended (const string &msg)
 
virtual void UnendedFrame (void)
 
TFlags GetFlags (void) const
 
TFlags SetFlags (TFlags flags)
 
TFlags ClearFlags (TFlags flags)
 
MLIOVIR void WriteNamedType (TTypeInfo namedTypeInfo, TTypeInfo typeInfo, TConstObjectPtr object)
 
MLIOVIR void WriteContainer (const CContainerTypeInfo *containerType, TConstObjectPtr containerPtr)
 
void WriteContainerElement (const CConstObjectInfo &element)
 
void WriteClassRandom (const CClassTypeInfo *classType, TConstObjectPtr classPtr)
 
void WriteClassSequential (const CClassTypeInfo *classType, TConstObjectPtr classPtr)
 
MLIOVIR void WriteClass (const CClassTypeInfo *objectType, TConstObjectPtr objectPtr)
 
MLIOVIR void WriteClassMember (const CMemberId &memberId, TTypeInfo memberType, TConstObjectPtr memberPtr)
 
MLIOVIR bool WriteClassMember (const CMemberId &memberId, const CDelayBuffer &buffer)
 
MLIOVIR void WriteAlias (const CAliasTypeInfo *aliasType, TConstObjectPtr aliasPtr)
 
MLIOVIR void CopyNamedType (TTypeInfo namedTypeInfo, TTypeInfo typeInfo, CObjectStreamCopier &copier)
 
MLIOVIR void CopyContainer (const CContainerTypeInfo *containerType, CObjectStreamCopier &copier)
 
MLIOVIR void CopyClassRandom (const CClassTypeInfo *objectType, CObjectStreamCopier &copier)
 
MLIOVIR void CopyClassSequential (const CClassTypeInfo *objectType, CObjectStreamCopier &copier)
 
MLIOVIR void CopyChoice (const CChoiceTypeInfo *choiceType, CObjectStreamCopier &copier)
 
MLIOVIR void CopyAlias (const CAliasTypeInfo *AliasType, CObjectStreamCopier &copier)
 
virtual void BeginChars (const CharBlock &block)
 
virtual void EndChars (const CharBlock &block)
 
void WritePointer (TConstObjectPtr object, TTypeInfo typeInfo)
 
void SetSpecialCaseWrite (ESpecialCaseWrite how)
 
MLIOVIR void WriteClassMemberSpecialCase (const CMemberId &memberId, TTypeInfo memberType, TConstObjectPtr memberPtr, ESpecialCaseWrite how)
 
- Public Member Functions inherited from CObjectStack
 CObjectStack (void)
 
virtual ~CObjectStack (void)
 
size_t GetStackDepth (void) const
 
TFramePushFrame (EFrameType type, TTypeInfo typeInfo, TConstObjectPtr objectPtr=0)
 
TFramePushFrame (EFrameType type, const CMemberId &memberId)
 
TFramePushFrame (EFrameType type)
 
void PopFrame (void)
 
void PopErrorFrame (void)
 
void SetTopMemberId (const CMemberId &memberId)
 
bool IsNsQualified (void)
 
bool IsCompressed (void) const
 
bool StackIsEmpty (void) const
 
void ClearStack (void)
 
string GetStackTraceASN (void) const
 
const TFrameTopFrame (void) const
 
TFrameTopFrame (void)
 
TFrameFetchFrameFromTop (size_t index)
 
const TFrameFetchFrameFromTop (size_t index) const
 
const TFrameFetchFrameFromBottom (size_t index) const
 
TTypeInfo GetRecentTypeInfo (void) const
 
const stringGetStackPath (void)
 
void WatchPathHooks (bool set=true)
 

Protected Member Functions

virtual void WriteBool (bool data)
 
virtual void WriteChar (char data)
 
virtual void WriteInt4 (Int4 data)
 
virtual void WriteUint4 (Uint4 data)
 
virtual void WriteInt8 (Int8 data)
 
virtual void WriteUint8 (Uint8 data)
 
virtual void WriteFloat (float data)
 
virtual void WriteDouble (double data)
 
void WriteDouble2 (double data, unsigned digits)
 
virtual void WriteCString (const char *str)
 
virtual void WriteString (const string &s, EStringType type=eStringTypeVisible)
 
virtual void WriteStringStore (const string &s)
 
virtual void CopyString (CObjectIStream &in, EStringType type=eStringTypeVisible)
 
virtual void CopyStringStore (CObjectIStream &in)
 
virtual void WriteNullPointer (void)
 
virtual void WriteObjectReference (TObjectIndex index)
 
virtual void WriteOtherBegin (TTypeInfo typeInfo)
 
virtual void WriteOtherEnd (TTypeInfo typeInfo)
 
virtual void WriteOther (TConstObjectPtr object, TTypeInfo typeInfo)
 
virtual void WriteNull (void)
 
virtual void WriteAnyContentObject (const CAnyContentObject &obj)
 
virtual void CopyAnyContentObject (CObjectIStream &in)
 
virtual void WriteBitString (const CBitString &obj)
 
virtual void CopyBitString (CObjectIStream &in)
 
virtual void WriteEnum (const CEnumeratedTypeValues &values, TEnumValueType value)
 
virtual void CopyEnum (const CEnumeratedTypeValues &values, CObjectIStream &in)
 
virtual void BeginNamedType (TTypeInfo namedTypeInfo)
 
virtual void EndNamedType (void)
 
virtual void BeginContainer (const CContainerTypeInfo *containerType)
 
virtual void EndContainer (void)
 
virtual void BeginContainerElement (TTypeInfo elementType)
 
virtual void EndContainerElement (void)
 
virtual void BeginClass (const CClassTypeInfo *classInfo)
 
virtual void EndClass (void)
 
virtual void BeginClassMember (const CMemberId &id)
 
virtual void EndClassMember (void)
 
virtual void BeginChoice (const CChoiceTypeInfo *choiceType)
 
virtual void EndChoice (void)
 
virtual void BeginChoiceVariant (const CChoiceTypeInfo *choiceType, const CMemberId &id)
 
virtual void EndChoiceVariant (void)
 
virtual void BeginBytes (const ByteBlock &block)
 
virtual void WriteBytes (const ByteBlock &block, const char *bytes, size_t length)
 
virtual void EndBytes (const ByteBlock &block)
 
virtual void WriteChars (const CharBlock &block, const char *chars, size_t length)
 
virtual void WriteSeparator (void)
 
- Protected Member Functions inherited from CObjectOStream
 CObjectOStream (ESerialDataFormat format, CNcbiOstream &out, EOwnership deleteOut=eNoOwnership)
 
virtual void WriteThis (TConstObjectPtr object, TTypeInfo typeInfo)
 
void RegisterObject (TTypeInfo typeInfo)
 
void RegisterObject (TConstObjectPtr object, TTypeInfo typeInfo)
 
void x_SetPathHooks (bool set)
 
EFixNonPrint x_GetFixCharsMethodDefault (void) const
 
EFixNonPrint x_FixCharsMethod (void) const
 
- Protected Member Functions inherited from CObjectStack
virtual void ResetState (void)
 

Private Member Functions

void WriteBase64Bytes (const char *bytes, size_t length)
 
void WriteBytes (const char *bytes, size_t length)
 
void WriteCustomBytes (const char *bytes, size_t length)
 
void WriteMemberId (const CMemberId &id)
 
void WriteSkippedMember (void)
 
void WriteEscapedChar (char c, EEncoding enc_in)
 
void WriteEncodedChar (const char *&src, EStringType type)
 
void x_WriteString (const string &value, EStringType type=eStringTypeVisible)
 
void WriteKey (const string &key)
 
void BeginValue (void)
 
void WriteValue (const string &value, EStringType type=eStringTypeVisible)
 
void WriteKeywordValue (const string &value)
 
void StartBlock (void)
 
void EndBlock (void)
 
void NextElement (void)
 
void BeginArray (void)
 
void EndArray (void)
 
void NameSeparator (void)
 

Private Attributes

bool m_BlockStart
 
bool m_ExpectValue
 
string m_SkippedMemberId
 
EEncoding m_StringEncoding
 
EBinaryDataFormat m_BinaryFormat
 
string m_JsonpPrefix
 
string m_JsonpSuffix
 
size_t m_WrapAt
 

Additional Inherited Members

- Static Public Member Functions inherited from CObjectOStream
static CObjectOStreamOpen (ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
 Create serial object writer and attach it to an output stream. More...
 
static CObjectOStreamOpen (ESerialDataFormat format, CNcbiOstream &outStream, EOwnership deleteOutStream=eNoOwnership, TSerial_Format_Flags formatFlags=0)
 Create serial object writer and attach it to an output stream. More...
 
static CObjectOStreamOpen (ESerialDataFormat format, const string &fileName, TSerialOpenFlags openFlags=0, TSerial_Format_Flags formatFlags=0)
 Create serial object writer and attach it to a file stream. More...
 
static CObjectOStreamOpen (const string &fileName, ESerialDataFormat format, TSerial_Format_Flags formatFlags=0)
 Create serial object writer and attach it to a file stream. More...
 
static void SetVerifyDataThread (ESerialVerifyData verify)
 Set up default output data verification for streams created by the current thread. More...
 
static void SetVerifyDataGlobal (ESerialVerifyData verify)
 Set up default output data verification for streams created by the current process. More...
 
- Public Attributes inherited from CObjectOStream
CLocalHookSet< CWriteObjectHookm_ObjectHookKey
 
CLocalHookSet< CWriteClassMemberHookm_ClassMemberHookKey
 
CLocalHookSet< CWriteChoiceVariantHookm_ChoiceVariantHookKey
 
- Protected Types inherited from CObjectOStream
typedef size_t TObjectIndex
 
- Protected Attributes inherited from CObjectOStream
COStreamBuffer m_Output
 
TFailFlags m_Fail
 
TFlags m_Flags
 
AutoPtr< CWriteObjectListm_Objects
 
string m_Separator
 
ESerialDataFormat m_DataFormat
 
EDelayBufferParsing m_ParseDelayBuffers
 
ESpecialCaseWrite m_SpecialCaseWrite
 
bool m_AutoSeparator
 
bool m_WriteNamedIntegersByValue
 
bool m_FastWriteDouble
 
bool m_EnforceWritingDefaults
 

Detailed Description

CObjectOStreamJson –.

Encode serial data object using JSON format

Definition at line 53 of file objostrjson.hpp.

Constructor & Destructor Documentation

CObjectOStreamJson::CObjectOStreamJson ( CNcbiOstream out,
bool  deleteOut 
)

Constructor.

Parameters
outOutput stream
deleteOutwhen TRUE, the output stream will be deleted automatically when the writer is deleted
Deprecated:
Use one with EOwnership enum instead

Definition at line 68 of file objostrjson.cpp.

References CObjectOStream::m_EnforceWritingDefaults, and CObjectOStream::m_WriteNamedIntegersByValue.

CObjectOStreamJson::CObjectOStreamJson ( CNcbiOstream out,
EOwnership  deleteOut 
)

Constructor.

Parameters
outOutput stream
deleteOutWhen eTakeOwnership, the output stream will be deleted automatically when the writer is deleted

Definition at line 80 of file objostrjson.cpp.

References CObjectOStream::m_EnforceWritingDefaults, and CObjectOStream::m_WriteNamedIntegersByValue.

CObjectOStreamJson::~CObjectOStreamJson ( void  )
virtual

Destructor.

Definition at line 92 of file objostrjson.cpp.

Member Function Documentation

void CObjectOStreamJson::BeginArray ( void  )
private
void CObjectOStreamJson::BeginBytes ( const ByteBlock block)
protectedvirtual
void CObjectOStreamJson::BeginChoice ( const CChoiceTypeInfo choiceType)
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 476 of file objostrjson.cpp.

References CObjectStack::FetchFrameFromTop(), CObjectStack::GetStackDepth(), and StartBlock().

void CObjectOStreamJson::BeginChoiceVariant ( const CChoiceTypeInfo choiceType,
const CMemberId id 
)
protectedvirtual
void CObjectOStreamJson::BeginClass ( const CClassTypeInfo classInfo)
protectedvirtual
void CObjectOStreamJson::BeginClassMember ( const CMemberId id)
protectedvirtual
void CObjectOStreamJson::BeginContainer ( const CContainerTypeInfo containerType)
protectedvirtual

Implements CObjectOStream.

Definition at line 417 of file objostrjson.cpp.

References BeginArray().

void CObjectOStreamJson::BeginContainerElement ( TTypeInfo  elementType)
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 427 of file objostrjson.cpp.

References NextElement().

void CObjectOStreamJson::BeginNamedType ( TTypeInfo  namedTypeInfo)
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 406 of file objostrjson.cpp.

References CObjectOStream::BeginNamedType().

void CObjectOStreamJson::BeginValue ( void  )
private
void CObjectOStreamJson::CopyAnyContentObject ( CObjectIStream in)
protectedvirtual

Implements CObjectOStream.

Definition at line 313 of file objostrjson.cpp.

References CObjectIStream::ReadAnyContentObject(), and WriteAnyContentObject().

void CObjectOStreamJson::CopyBitString ( CObjectIStream in)
protectedvirtual

Implements CObjectOStream.

Definition at line 362 of file objostrjson.cpp.

References CObjectOStream::fNotImplemented, and ThrowError.

void CObjectOStreamJson::CopyEnum ( const CEnumeratedTypeValues values,
CObjectIStream in 
)
protectedvirtual

Implements CObjectOStream.

Definition at line 385 of file objostrjson.cpp.

References CObjectIStream::ReadEnum(), value, and WriteEnum().

void CObjectOStreamJson::CopyString ( CObjectIStream in,
EStringType  type = eStringTypeVisible 
)
protectedvirtual

Implements CObjectOStream.

Definition at line 230 of file objostrjson.cpp.

References CObjectIStream::ReadString(), and WriteString().

void CObjectOStreamJson::CopyStringStore ( CObjectIStream in)
protectedvirtual

Implements CObjectOStream.

Definition at line 238 of file objostrjson.cpp.

References CObjectIStream::ReadStringStore(), and WriteStringStore().

void CObjectOStreamJson::EndArray ( void  )
private
void CObjectOStreamJson::EndBlock ( void  )
private
void CObjectOStreamJson::EndBytes ( const ByteBlock block)
protectedvirtual
void CObjectOStreamJson::EndChoice ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 484 of file objostrjson.cpp.

References EndBlock(), CObjectStack::FetchFrameFromTop(), and CObjectStack::GetStackDepth().

void CObjectOStreamJson::EndChoiceVariant ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 504 of file objostrjson.cpp.

References CObjectStackFrame::SetNotag(), and CObjectStack::TopFrame().

void CObjectOStreamJson::EndClass ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 446 of file objostrjson.cpp.

References EndBlock(), CObjectStack::FetchFrameFromTop(), and CObjectStack::GetStackDepth().

void CObjectOStreamJson::EndClassMember ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 468 of file objostrjson.cpp.

References CObjectStackFrame::SetNotag(), and CObjectStack::TopFrame().

void CObjectOStreamJson::EndContainer ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 422 of file objostrjson.cpp.

References EndArray().

void CObjectOStreamJson::EndContainerElement ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 432 of file objostrjson.cpp.

void CObjectOStreamJson::EndNamedType ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 411 of file objostrjson.cpp.

References CObjectOStream::EndNamedType().

void CObjectOStreamJson::EndOfWrite ( void  )
virtual
CObjectOStreamJson::EBinaryDataFormat CObjectOStreamJson::GetBinaryDataFormat ( void  ) const

Get formatting of binary data.

Returns
Formatting type

Definition at line 107 of file objostrjson.cpp.

References m_BinaryFormat.

EEncoding CObjectOStreamJson::GetDefaultStringEncoding ( void  ) const

Get default encoding of 'string' objects.

Returns
Encoding

Definition at line 101 of file objostrjson.cpp.

References m_StringEncoding.

void CObjectOStreamJson::GetJsonpPadding ( string prefix,
string suffix 
) const

Get JSONP padding (prefix and suffix)

Parameters
prefixReceives JSONP prefix
suffixReceives JSONP suffix

Definition at line 122 of file objostrjson.cpp.

References m_JsonpPrefix, and m_JsonpSuffix.

string CObjectOStreamJson::GetPosition ( void  ) const
virtual

Get current stream position as string.

Useful for diagnostic and information messages.

Returns
string

Reimplemented from CObjectOStream.

Definition at line 128 of file objostrjson.cpp.

References COStreamBuffer::GetLine(), CObjectOStream::m_Output, and NStr::SizetToString().

void CObjectOStreamJson::NameSeparator ( void  )
private
void CObjectOStreamJson::NextElement ( void  )
private
void CObjectOStreamJson::SetBinaryDataFormat ( CObjectOStreamJson::EBinaryDataFormat  fmt)

Set formatting of binary data.

Parameters
fmtFormatting type

Definition at line 111 of file objostrjson.cpp.

References m_BinaryFormat.

void CObjectOStreamJson::SetDefaultStringEncoding ( EEncoding  enc)

Set default encoding of 'string' objects.

Parameters
encEncoding

Definition at line 96 of file objostrjson.cpp.

References m_StringEncoding.

Referenced by s_WriteJSONObject(), and s_WriteJSONObjectNoHeader().

void CObjectOStreamJson::SetJsonpMode ( const string function_name)

Set JSONP mode JSONP prefix will become "function_name(" JSONP suffix will become ");".

Definition at line 116 of file objostrjson.cpp.

References m_JsonpPrefix, and m_JsonpSuffix.

void CObjectOStreamJson::StartBlock ( void  )
private
void CObjectOStreamJson::WriteAnyContentObject ( const CAnyContentObject obj)
protectedvirtual
void CObjectOStreamJson::WriteBase64Bytes ( const char *  bytes,
size_t  length 
)
private
void CObjectOStreamJson::WriteBitString ( const CBitString obj)
protectedvirtual
void CObjectOStreamJson::WriteBool ( bool  data)
protectedvirtual

Implements CObjectOStream.

Definition at line 155 of file objostrjson.cpp.

References WriteKeywordValue().

void CObjectOStreamJson::WriteBytes ( const ByteBlock block,
const char *  bytes,
size_t  length 
)
protectedvirtual
void CObjectOStreamJson::WriteBytes ( const char *  bytes,
size_t  length 
)
private

Definition at line 582 of file objostrjson.cpp.

References HEX, CObjectOStream::m_Output, and COStreamBuffer::PutChar().

void CObjectOStreamJson::WriteChar ( char  data)
protectedvirtual

Implements CObjectOStream.

Definition at line 160 of file objostrjson.cpp.

References WriteString().

void CObjectOStreamJson::WriteChars ( const CharBlock block,
const char *  chars,
size_t  length 
)
protectedvirtual

Implements CObjectOStream.

Definition at line 646 of file objostrjson.cpp.

References CObjectOStream::fNotImplemented, and ThrowError.

void CObjectOStreamJson::WriteCString ( const char *  str)
protectedvirtual

Implements CObjectOStream.

Definition at line 214 of file objostrjson.cpp.

References WriteValue().

void CObjectOStreamJson::WriteCustomBytes ( const char *  bytes,
size_t  length 
)
private
void CObjectOStreamJson::WriteDouble ( double  data)
protectedvirtual

Implements CObjectOStream.

Definition at line 192 of file objostrjson.cpp.

References WriteDouble2().

void CObjectOStreamJson::WriteDouble2 ( double  data,
unsigned  digits 
)
protected
void CObjectOStreamJson::WriteEncodedChar ( const char *&  src,
EStringType  type 
)
private
void CObjectOStreamJson::WriteEnum ( const CEnumeratedTypeValues values,
TEnumValueType  value 
)
protectedvirtual
void CObjectOStreamJson::WriteEscapedChar ( char  c,
EEncoding  enc_in 
)
private
void CObjectOStreamJson::WriteFileHeader ( TTypeInfo  type)
virtual
void CObjectOStreamJson::WriteFloat ( float  data)
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 187 of file objostrjson.cpp.

References WriteDouble2().

void CObjectOStreamJson::WriteInt4 ( Int4  data)
protectedvirtual

Implements CObjectOStream.

Definition at line 167 of file objostrjson.cpp.

References NStr::IntToString(), and WriteKeywordValue().

void CObjectOStreamJson::WriteInt8 ( Int8  data)
protectedvirtual

Implements CObjectOStream.

Definition at line 177 of file objostrjson.cpp.

References NStr::Int8ToString(), and WriteKeywordValue().

void CObjectOStreamJson::WriteKey ( const string key)
private
void CObjectOStreamJson::WriteKeywordValue ( const string value)
private
void CObjectOStreamJson::WriteMemberId ( const CMemberId id)
private

Definition at line 657 of file objostrjson.cpp.

References m_SkippedMemberId, and WriteKey().

Referenced by BeginChoiceVariant(), and BeginClassMember().

void CObjectOStreamJson::WriteNull ( void  )
protectedvirtual

Implements CObjectOStream.

Definition at line 273 of file objostrjson.cpp.

References m_ExpectValue, m_SkippedMemberId, and WriteKeywordValue().

void CObjectOStreamJson::WriteNullPointer ( void  )
protectedvirtual
void CObjectOStreamJson::WriteObjectReference ( TObjectIndex  index)
protectedvirtual

Implements CObjectOStream.

Definition at line 253 of file objostrjson.cpp.

References CObjectOStream::fNotImplemented, and ThrowError.

void CObjectOStreamJson::WriteOther ( TConstObjectPtr  object,
TTypeInfo  typeInfo 
)
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 268 of file objostrjson.cpp.

References CObjectOStream::fNotImplemented, and ThrowError.

void CObjectOStreamJson::WriteOtherBegin ( TTypeInfo  typeInfo)
protectedvirtual

Implements CObjectOStream.

Definition at line 258 of file objostrjson.cpp.

References CObjectOStream::fNotImplemented, and ThrowError.

void CObjectOStreamJson::WriteOtherEnd ( TTypeInfo  typeInfo)
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 263 of file objostrjson.cpp.

References CObjectOStream::fNotImplemented, and ThrowError.

void CObjectOStreamJson::WriteSeparator ( void  )
protectedvirtual

Reimplemented from CObjectOStream.

Definition at line 653 of file objostrjson.cpp.

void CObjectOStreamJson::WriteSkippedMember ( void  )
private

Definition at line 663 of file objostrjson.cpp.

References m_SkippedMemberId, NextElement(), and WriteKey().

Referenced by BeginValue().

void CObjectOStreamJson::WriteString ( const string s,
EStringType  type = eStringTypeVisible 
)
protectedvirtual

Implements CObjectOStream.

Definition at line 219 of file objostrjson.cpp.

References WriteValue().

Referenced by CopyString(), WriteChar(), and WriteStringStore().

void CObjectOStreamJson::WriteStringStore ( const string s)
protectedvirtual

Implements CObjectOStream.

Definition at line 225 of file objostrjson.cpp.

References WriteString().

Referenced by CopyStringStore().

void CObjectOStreamJson::WriteUint4 ( Uint4  data)
protectedvirtual

Implements CObjectOStream.

Definition at line 172 of file objostrjson.cpp.

References NStr::UIntToString(), and WriteKeywordValue().

void CObjectOStreamJson::WriteUint8 ( Uint8  data)
protectedvirtual

Implements CObjectOStream.

Definition at line 182 of file objostrjson.cpp.

References NStr::UInt8ToString(), and WriteKeywordValue().

void CObjectOStreamJson::WriteValue ( const string value,
EStringType  type = eStringTypeVisible 
)
private
void CObjectOStreamJson::x_WriteString ( const string value,
EStringType  type = eStringTypeVisible 
)
private

Definition at line 713 of file objostrjson.cpp.

References CObjectOStream::m_Output, COStreamBuffer::PutChar(), and WriteEncodedChar().

Referenced by WriteKey(), and WriteValue().

Member Data Documentation

EBinaryDataFormat CObjectOStreamJson::m_BinaryFormat
private
bool CObjectOStreamJson::m_BlockStart
private

Definition at line 237 of file objostrjson.hpp.

Referenced by BeginArray(), EndArray(), EndBlock(), NextElement(), and StartBlock().

bool CObjectOStreamJson::m_ExpectValue
private
string CObjectOStreamJson::m_JsonpPrefix
private

Definition at line 242 of file objostrjson.hpp.

Referenced by EndOfWrite(), GetJsonpPadding(), SetJsonpMode(), and WriteFileHeader().

string CObjectOStreamJson::m_JsonpSuffix
private

Definition at line 243 of file objostrjson.hpp.

Referenced by EndOfWrite(), GetJsonpPadding(), SetJsonpMode(), and WriteFileHeader().

string CObjectOStreamJson::m_SkippedMemberId
private
EEncoding CObjectOStreamJson::m_StringEncoding
private
size_t CObjectOStreamJson::m_WrapAt
private

Definition at line 244 of file objostrjson.hpp.

Referenced by BeginBytes(), WriteBase64Bytes(), and WriteCustomBytes().


The documentation for this class was generated from the following files:
Modified on Wed Sep 28 19:29:02 2016 by modify_doxy.py rev. 506947