A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/cuCdReadWriteASN_8hpp_source.html below:

NCBI C++ ToolKit: include/algo/structure/cd_utils/cuCdReadWriteASN.hpp Source File

2 #ifndef CU_CDREADWRITEASN_HPP 3 #define CU_CDREADWRITEASN_HPP 27 template

<

class

ASNClassOld,

class

ASNClassNew >

35

ncbi::CObjectOStreamAsnBinary outObject(asnIOstream);

36

outObject << originalObject;

39

ncbi::CObjectIStreamAsnBinary inObject(asnIOstream);

41

inObject >> newObject;

43

}

catch

(exception& e) {

51 template

<

class

ASNClass >

56

unique_ptr<ASNClass> newObject;

60

ncbi::CObjectOStreamAsnBinary outObject(asnIOstream);

61

outObject << originalObject;

64

ncbi::CObjectIStreamAsnBinary inObject(asnIOstream);

65

newObject.reset(

new

ASNClass());

66

inObject >> *newObject;

68

}

catch

(exception& e) {

72  return

newObject.release();

80 template

<

class

ASNClass >

90

*err =

"Cannot open file for reading"

;

93

unique_ptr<ncbi::CObjectIStream> inObject;

96

inObject.reset(

new

ncbi::CObjectIStreamAsnBinary(inStream));

99

inObject.reset(

new

ncbi::CObjectIStreamAsn(inStream));

103

*inObject >> *ASNobject;

104

}

catch

(exception& e) {

113 template

<

class

ASNClass >

119

*err =

"Input stream is bad."

;

122

unique_ptr<ncbi::CObjectIStream> inObject;

125

inObject.reset(

new

ncbi::CObjectIStreamAsnBinary(is));

128

inObject.reset(

new

ncbi::CObjectIStreamAsn(is));

132

*inObject >> *ASNobject;

133

}

catch

(exception& e) {

143 template

<

class

ASNClass >

145 static bool WriteASNToFile

(

const char

*filename,

const

ASNClass& ASNobject,

bool

isBinary,

154

*err =

"Cannot open file for writing"

;

157

unique_ptr<ncbi::CObjectOStream> outObject;

160

outObject.reset(

new

ncbi::CObjectOStreamAsnBinary(outStream, fixNonPrint));

163

outObject.reset(

new

ncbi::CObjectOStreamAsn(outStream, fixNonPrint));

167

*outObject << ASNobject;

168

}

catch

(exception& e) {

177 template

<

class

ASNClass >

184

*err =

"Stream for writing is bad"

;

187

unique_ptr<ncbi::CObjectOStream> outObject;

190

outObject.reset(

new

ncbi::CObjectOStreamAsnBinary(os, fixNonPrint));

193

outObject.reset(

new

ncbi::CObjectOStreamAsn(os, fixNonPrint));

197

*outObject << ASNobject;

198

}

catch

(exception& e) {

205 template

<

class

ASNContainerClass >

215  if

(!inStream->InGoodState())

217

inStream->SkipFileHeader(ASNContainerClass::GetTypeInfo());

224 template

<

class

ASNContainerClass ,

class

ASNElementClass >

234

inStream(filename, isBinary),

235

containerIterator(inStream.GetInStream(),

CObjectTypeInfo

(ASNContainerClass::GetTypeInfo()))

241  if

(containerIterator.

HaveMore

()) {

243

containerIterator >> *element;

ASNInputContainerStream(const string &filename, bool isBinary)

CIStreamContainerIterator containerIterator

CObjectIStreamHelper< ASNContainerClass > inStream

bool ReadElement(ASNElementClass *element)

Reading (iterating through) elements of containers (SET OF, SEQUENCE OF).

unique_ptr< CObjectIStream > inStream

CObjectIStream & GetInStream(void)

CObjectIStreamHelper(const string &filename, bool isBinary)

static void TransformASNObject(ASNClassNew &newObject, const ASNClassOld &originalObject, std::string *err)

static bool ReadASNFromStream(ncbi::CNcbiIstream &is, ASNClass *ASNobject, bool isBinary, std::string *err)

static bool ReadASNFromFile(const char *filename, ASNClass *ASNobject, bool isBinary, std::string *err)

static ASNClass * CopyASNObject(const ASNClass &originalObject, std::string *err)

static bool WriteASNToFile(const char *filename, const ASNClass &ASNobject, bool isBinary, std::string *err, ncbi::EFixNonPrint fixNonPrint=ncbi::eFNP_Default)

static bool WriteASNToStream(ncbi::CNcbiOstream &os, const ASNClass &ASNobject, bool isBinary, std::string *err, ncbi::EFixNonPrint fixNonPrint=ncbi::eFNP_Default)

std::ofstream out("events_result.xml")

main entry point for tests

#define NCBI_USER_THROW(message)

Throw a quick-and-dirty runtime exception of type 'CException' with the given error message and error...

EFixNonPrint

How to process non-printing character in the ASN VisibleString.

@ eSerial_AsnText

ASN.1 text.

@ eSerial_AsnBinary

ASN.1 binary.

bool HaveMore(void) const

static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)

Create serial object reader and attach it to an input stream.

IO_PREFIX::ofstream CNcbiOfstream

Portable alias for ofstream.

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

CNcbistrstream_Base< IO_PREFIX::strstream, IOS_BASE::in|IOS_BASE::out > CNcbiStrstream

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

#define NCBI_CDUTILS_EXPORT

Defines command line argument related classes.

NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.

std::istream & in(std::istream &in_, double &x_)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4