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/prt2fsm_8cpp_source.html below:

NCBI C++ ToolKit: src/app/prt2fsm/prt2fsm.cpp Source File

51  void Init

()

override

;

63

arg_desc->SetUsageContext(

""

,

"Suspect Product Rules to FSM"

);

66

SetupArgDescriptions(arg_desc.release());

73  str

.reserve(s.size() + 2);

95  bool

needopen =

false

;

100  unsigned char

ch = *ptr++; --

size

;

101  if

(ch ==

'"'

|| ch < 32 || ch >= 128) {

134  unsigned char

ch = *ptr++; --

size

;

136

ostr <<

"0x"

<< temp <<

", "

;

145  static

constexpr

size_t

m_buffer_size = 64;

149

m_buffer.reset(

new char

[m_buffer_size]);

150

_MyBase::setp(m_buffer.get(), m_buffer.get() + m_buffer_size);

173  size_t size

= pptr() - pbase();

176

_MyBase::setp(m_buffer.get(), m_buffer.get() + m_buffer_size);

180

std::ostream * m_ostr =

nullptr

;

183 static const

pair<string, CMultipatternSearch::TFlags>

FlagNames

[] = {

199  auto types

= istr->GuessDataType({CSuspect_rule_set::GetTypeInfo()});

200  if

(

types

.size() != 1 || *

types

.begin() != CSuspect_rule_set::GetTypeInfo())

210

*istr >> ProductRules;

215  for

(

auto

rule : ProductRules.

Get

()) {

216  patterns

.push_back(rule->GetFind().GetRegex());

221  "// This code was generated by the prt2fsm application.\n" 222  "// (see .../src/app/prt2fsm)\n" 226  if

(!filename.empty()) {

227

ostr <<

" -i "

<< filename;

232

ostr <<

"// Binary ASN.1 of CSuspect_rule_set object\n"

;

233

ostr <<

"NCBI_FSM_RULES = {\n"

;

237

std::ostream

str

(&

buf

);

239

*objostr << ProductRules;

243  FSM

.GenerateArrayMapData(ostr);

250

vector<pair<string, CMultipatternSearch::TFlags>> input;

254  while

(std::getline(

file

, line)) {

259  if

((m = line.find(

"//"

)) != string::npos) {

260

comment = line.substr(m);

261

line = line.substr(0, m);

263  if

((m = line.find_first_not_of(

" \t"

)) != string::npos) {

264

line = line.substr(m);

266  if

((m = line.find_last_not_of(

" \t"

)) != string::npos) {

267

line = line.substr(0, m + 1);

269  unsigned int flags

= 0;

271  if

(comment.find(

f

.first) != string::npos) {

275

input.push_back(pair<string, unsigned int>(line,

flags

));

279  if

((m = fname.find_last_of(

"\\/"

)) != string::npos) {

280

fname = fname.substr(m + 1);

283  for

(

size_t i

= 1;

i

<= args.GetNExtra();

i

++) {

284  string

param = args[

"#"

+ to_string(

i

)].AsString();

285

params +=

" "

+ param;

286

input.push_back(pair<string, unsigned int>(param, 0));

292  FSM

.AddPatterns(input);

298

ostr <<

"//\n// This code was generated by the multipattern application.\n//\n// Command line:\n// multipattern -A"

;

299  if

(!fname.empty()) {

300

ostr <<

" -i "

<< fname;

303  FSM

.GenerateArrayMapData(ostr);

317

fname = args[

"i"

].AsString();

320

std::ostream* ostr = &std::cout;

322

ostr = &args[

"o"

].AsOutputFile();

324

ifstream

file

(fname);

337 int main

(

int

argc,

const char

* argv[])

User-defined methods of the data storage class.

User-defined methods of the data storage class.

User-defined methods of the data storage class.

int_type overflow(int_type ch) override

std::unique_ptr< char > m_buffer

CBinaryToCPP(std::ostream &downstream)

std::basic_streambuf< char > _MyBase

int Run() override

Run the application.

void Init() override

Initialize the application.

Root class for all serialization exceptions.

static const char * str(char *buf, int n)

static const struct type types[]

int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)

Main function (entry point) for the NCBI application.

@ eInputFile

Name of file (must exist and be readable)

@ eOutputFile

Name of file (must be writable)

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

@ eSerial_AsnText

ASN.1 text.

@ eSerial_AsnBinary

ASN.1 binary.

static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)

Create serial object writer and attach it to an output stream.

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

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

static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)

Convert numeric value to string.

void Run(void)

Enter the main loop.

const Tdata & Get(void) const

Get the member data.

Simultaneous search of multiple RegEx patterns in the input string.

const struct ncbi::grid::netcache::search::fields::SIZE size

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

#define GetArgs

Avoid preprocessor name clash with the NCBI C Toolkit.

bool xTryProductRules(const string &filename, std::istream &file, std::ostream &ostr)

void QuoteBinary(std::ostream &ostr, const char *ptr, size_t size)

void QuoteBinaryHex(std::ostream &ostr, const char *ptr, size_t size)

int main(int argc, const char *argv[])

string QuoteString(const string &s)

static const pair< string, CMultipatternSearch::TFlags > FlagNames[]

bool xTryTextFile(const string &fname, std::istream &file, std::ostream &ostr)


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