57 const string & ustat_type,
CNcbiOstream & os,
bool use_ba,
58 string const & metadata )
62 if( ustat_type.substr( 0, 5 ) ==
"ascii" )
64 else if( ustat_type.substr( 0, 6 ) ==
"binary" )
66 else if( ustat_type.substr( 0, 6 ) ==
"oascii" )
68 Uint4 size = atoi( ustat_type.substr( 6 ).c_str() );
71 else if( ustat_type.substr( 0, 7 ) ==
"obinary" )
73 Uint4 size = atoi( ustat_type.substr( 7 ).c_str() );
78 "unkown unit counts format" );
82 "could not create a unit counts container" );
84 catch( std::exception & e )
88 std::string(
"could not create a unit counts container" ) +
95 const string & ustat_type,
const string & name,
bool use_ba,
96 string const & metadata )
100 if( ustat_type.substr( 0, 5 ) ==
"ascii" )
102 else if( ustat_type.substr( 0, 6 ) ==
"binary" )
104 else if( ustat_type.substr( 0, 6 ) ==
"oascii" )
106 Uint4 size = atoi( ustat_type.substr( 6 ).c_str() );
109 else if( ustat_type.substr( 0, 7 ) ==
"obinary" )
111 Uint4 size = atoi( ustat_type.substr( 7 ).c_str() );
116 "unkown unit counts format" );
120 "could not create a unit counts container" );
122 catch( std::exception & e )
126 std::string(
"could not create a unit counts container" ) +
Class responsible for creation of unit counts statistics in text format.
Compute and save counts information in simple binary format.
Exceptions that CSeqMaskerOstatFactory might throw.
virtual const char * GetErrCodeString() const override
Get a description string for this exception.
@ eCreateFail
Failure to create the requested object.
@ eBadName
Unknown format name.
static CSeqMaskerOstat * create(const string &ustat_type, const string &name, bool use_ba, string const &metadata="")
Method used to create a CSeqMakserOstat object by format name.
This class is responsible for saving optimized unit counts in text format.
This class is responsible for saving optimized unit counts in binary format.
Base class for computing and saving unit counts data.
TErrCode GetErrCode(void) const
Get error code.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
#define NCBI_RETHROW(prev_exception, exception_class, err_code, message)
Generic macro to re-throw an exception.
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
const struct ncbi::grid::netcache::search::fields::SIZE size