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

NCBI C++ ToolKit: src/objtools/flatfile/xm_index.cpp Source File

49 #define THIS_FILE "xm_index.cpp" 51 #define XML_FAKE_ACC_TAG "AC " 155  buf

.reserve(s.size());

157  for

(

size_t i

= 0;

i

< s.size();) {

158  if

(s[

i

] !=

'&'

) {

162  if

(s.substr(

i

, 4) == string_view(

"&lt;"

, 4)) {

165

}

else if

(s.substr(

i

, 4) == string_view(

"&gt;"

, 4)) {

168

}

else if

(s.substr(

i

, 5) == string_view(

"&amp;"

, 5)) {

171

}

else if

(s.substr(

i

, 6) == string_view(

"&apos;"

, 6)) {

174

}

else if

(s.substr(

i

, 6) == string_view(

"&quot;"

, 6)) {

190  return

make_unique<string>();

199  for

(

const auto

& xip : xil)

209  return

(

config

.ffbuf.start !=

nullptr

);

215  if

(*

config

.ffbuf.current ==

'\0'

) {

218  return

*(

config

.ffbuf.current++);

230

TXmlIndexList::iterator xip;

246  auto

tibnp = ibl.before_begin();

250  bool

within =

false

;

254  for

(

count

= 0, line = 1;;) {

260  if

((

Char

)c ==

'\n'

)

267  for

(

i

= 1;

i

< 50;

i

++) {

276  if

(ch ==

'<'

|| ch ==

'>'

)

293

xip = ibp->

xip

.before_begin();

295

tibnp = ibl.emplace_after(tibnp, ibp);

310

p = s + ((s[1] ==

'/'

) ? 2 : 1);

311  for

(xkbp =

xmkwl

; xkbp->

str

; xkbp++)

316  if

(ibp->

xip

.empty() || xip->tag != xkbp->

tag

) {

317

xip = ibp->

xip

.emplace_after(xip);

318

xip->tag = xkbp->

tag

;

319

xip->order = xkbp->

order

;

322

xip->end_line = line;

325

xip->start_line = line;

331

xip = ibp->

xip

.emplace_after(xip);

332

xip->tag = xkbp->

tag

;

333

xip->order = xkbp->

order

;

336

xip->end_line = line;

338  if

(xip->start != 0) {

339

xip = ibp->

xip

.emplace_after(xip);

340

xip->tag = xkbp->

tag

;

341

xip->order = xkbp->

order

;

344

xip->start_line = line;

349  for

(

auto

& it : ibl) {

363  for

(

char

c : *line) {

364  if

(c ==

' '

|| c ==

'\t'

) {

371  auto

q = line->rfind(

'.'

);

372  if

(q == string::npos) {

377  if

(ibp->

acnum

!= line->substr(0, q)) {

384  for

(

auto

p = line->begin() + q; p < line->end(); ++p) {

386  if

(! (ch >=

'0'

&& ch <=

'9'

)) {

403  if

(! ibp || ibp->

xip

.empty() || ! entry)

410

ibp->

acnum

[0] =

'\0'

;

411  for

(

const auto

& xip : ibp->

xip

) {

413  if

(xip.start == 0 || xip.end == 0 || xip.start >= xip.end ||

419  size_t

imax = xip.end - xip.start;

420  if

(imax > (

int

)

sizeof

(ibp->

locusname

) - 1)

426  if

(xip.start == 0 || xip.end == 0 || xip.start >= xip.end) {

430  size_t

imax = xip.end - xip.start;

431  if

(imax > (

int

)

sizeof

(ibp->

acnum

) - 1)

432

imax =

sizeof

(ibp->

acnum

) - 1;

434

ibp->

acnum

[imax] =

'\0'

;

441  if

(ibp->

acnum

[0] ==

'\0'

)

447  for

(

const auto

& xip : ibp->

xip

) {

460

ibp->

date

=

nullptr

;

462  for

(

const auto

& xip : ibp->

xip

) {

474  if

(xip.start == 0 || xip.end == 0 || xip.start >= xip.end ||

475

xip.end - xip.start < 3)

500  for

(; xkbp->

str

; xkbp++)

505  return

(xkbp->

str

);

512  for

(

auto

txip = xil.begin(); txip != xil.end(); ++txip) {

513  if

(txip->start == 0) {

517  if

(txip->end == 0) {

521  if

(

auto const

nxt =

next

(txip); nxt != xil.end() && txip->order >= nxt->order) {

534  for

(

const auto

& txip : xil) {

535  if

(txip.start == 0) {

551  auto

txipsub = xipsub.before_begin();

569

c = entry + xip.

start

;

574  if

(*c ==

'\0'

||

count

> xip.

end

)

582  for

(s[0] =

'<'

,

i

= 1;

i

< 50;

i

++) {

585  if

(*c ==

'\0'

||

count

> xip.

end

)

590  if

(*c ==

'<'

|| *c ==

'>'

)

593  if

(*c ==

'\0'

||

count

> xip.

end

)

598

p = s + ((s[1] ==

'/'

) ? 2 : 1);

602  if

(xipsub.empty()) {

603

txipsub = xipsub.emplace_after(txipsub);

604

}

else if

((s[1] !=

'/'

&& txipsub->start != 0) ||

605

(s[1] ==

'/'

&& txipsub->end != 0)) {

606

txipsub = xipsub.emplace_after(txipsub);

609

txipsub->end =

count

-

i

;

610

txipsub->end_line = line;

612

txipsub->start =

count

;

613

txipsub->start_line = line;

632  auto

xip = ibp->

xip

.begin();

633  for

(; xip != ibp->

xip

.end(); ++xip)

637  if

(xip == ibp->

xip

.end()) {

646  if

(xip->subtags.empty()) {

653  for

(

const auto

& xipsec : xip->subtags)

654  len

+= (xipsec.end - xipsec.start + 1);

659  for

(

const auto

& xipsec : xip->subtags) {

675  if

(! entry || ! ibp || ibp->

xip

.empty())

678  auto

xip = ibp->

xip

.begin();

679  for

(; xip != ibp->

xip

.end(); ++xip)

682  if

(xip == ibp->

xip

.end())

686  if

(xip->subtags.empty()) {

694  for

(

const auto

& xipkwd : xip->subtags)

695  len

+= (xipkwd.end - xipkwd.start + 2);

699  for

(

const auto

& xipkwd : xip->subtags) {

723  bool

got_locus =

false

;

724  bool

got_length =

false

;

725  bool

got_moltype =

false

;

726  bool

got_division =

false

;

727  bool

got_update_date =

false

;

728  bool

got_definition =

false

;

729  bool

got_accession =

false

;

730  bool

got_version =

false

;

731  bool

got_source =

false

;

732  bool

got_organism =

false

;

733  bool

got_reference =

false

;

734  bool

got_primary =

false

;

735  bool

got_features =

false

;

740  for

(

const auto

& xip : ibp->

xip

) {

748

got_division =

true

;

750

got_update_date =

true

;

752

got_definition =

true

;

754

got_accession =

true

;

760

got_organism =

true

;

762

got_reference =

true

;

766

got_features =

true

;

775  if

(got_length ==

false

)

777  if

(got_moltype ==

false

)

779  if

(got_division ==

false

)

783  if

(got_definition ==

false

)

785  if

(got_accession ==

false

) {

789  if

(got_version ==

false

) {

790  if

(pp->

accver

!=

false

)

796  if

(got_source ==

false

)

798  if

(got_organism ==

false

)

808  if

(got_features ==

false

)

830  if

(! ibp || ibp->

len

== 0)

837  for

(p = entry,

i

= 0;

i

< ibp->

len

;

i

++) {

844  if

(c > 126 || (c < 32 && c != 10)) {

851  if

(

i

!= ibp->

len

) {

865  auto

xipsub = xip.

subtags

.before_begin();

878

c = entry + xip.

start

;

883  if

(*c ==

'\0'

||

count

> xip.

end

)

891  for

(s[0] =

'<'

,

i

= 1;

i

< 50;

i

++) {

894  if

(*c ==

'\0'

||

count

> xip.

end

)

899  if

(*c ==

'<'

|| *c ==

'>'

)

902  if

(*c ==

'\0'

||

count

> xip.

end

)

907

p = s + ((s[1] ==

'/'

) ? 2 : 1);

908  for

(txkbp = xkbp; txkbp->

str

; txkbp++)

913  if

(xip.

subtags

.empty() || xipsub->tag != txkbp->

tag

) {

914

xipsub = xip.

subtags

.emplace_after(xipsub);

915

xipsub->tag = txkbp->

tag

;

916

xipsub->order = txkbp->

order

;

919

xipsub->end_line = line;

921

xipsub->start =

count

;

922

xipsub->start_line = line;

927  if

(xipsub->end != 0) {

928

xipsub = xip.

subtags

.emplace_after(xipsub);

929

xipsub->tag = txkbp->

tag

;

930

xipsub->order = txkbp->

order

;

933

xipsub->end_line = line;

935  if

(xipsub->start != 0) {

936

xipsub = xip.

subtags

.emplace_after(xipsub);

937

xipsub->tag = txkbp->

tag

;

938

xipsub->order = txkbp->

order

;

940

xipsub->start =

count

;

941

xipsub->start_line = line;

954  bool

got_key =

false

;

955  bool

got_location =

false

;

958  for

(

const auto

& xip : xil) {

962

got_location =

true

;

970  if

(! got_location) {

980  bool

got_from =

false

;

981  bool

got_to =

false

;

982  bool

got_point =

false

;

983  bool

got_accession =

false

;

986  for

(

const auto

& xip : xil) {

994

got_accession =

true

;

997  if

(! got_accession) {

1003  if

(got_from || got_to) {

1007

}

else if

(got_from ==

false

|| got_to ==

false

) {

1008  FtaErrPost

(

SEV_ERROR

,

ERR_FORMAT_XMLInvalidINSDInterval

,

"{} must contain either both of {} and {}, or {}."

,

XMLStringByTag

(

xmsubkwl

,

INSDINTERVAL

),

XMLStringByTag

(

xmintkwl

,

INSDINTERVAL_FROM

),

XMLStringByTag

(

xmintkwl

,

INSDINTERVAL_TO

),

XMLStringByTag

(

xmintkwl

,

INSDINTERVAL_POINT

));

1018  for

(

const auto

& xip : xil) {

1030  if

(! entry || xil.empty())

1033  auto

xip = xil.begin();

1034  for

(; xip != xil.end(); ++xip) {

1039  if

(xip == xil.end())

1043  if

(xip->subtags.empty()) {

1048  auto

xipfeat = xip->subtags.begin();

1049  for

(; xipfeat != xip->subtags.end(); ++xipfeat) {

1053  auto

txip = xipfeat->subtags.begin();

1054  for

(; txip != xipfeat->subtags.end(); ++txip) {

1057  if

(txip->subtags.empty())

1059  for

(

auto

& xipsub : txip->subtags)

1065  if

(txip->subtags.empty())

1067  for

(

auto

& xipsub : txip->subtags)

1073  if

(txip != xipfeat->subtags.end())

1077  if

(xipfeat == xip->subtags.end())

1087  bool

got_reference =

false

;

1088  bool

got_journal =

false

;

1091  for

(

const auto

& xip : xil) {

1093

got_reference =

true

;

1095

got_journal =

true

;

1098  if

(! got_reference) {

1103  if

(! got_journal) {

1113  if

(! reftag || *reftag ==

'\0'

)

1116  const string str

=

"1.."

+ to_string(bases);

1132  for

(p = reftag; *p !=

'\0'

&& *p !=

'('

;)

1137  const string str

=

"(bases 1 to "

+ to_string(bases) +

")"

;

1138  const string

str1 =

"(bases 1 to "

+ to_string(bases) +

";"

;

1150  bool

got_dbname =

false

;

1151  bool

got_id =

false

;

1154  for

(

const auto

& xip : xil) {

1176  if

(! entry || xil.empty())

1179  auto

xip = xil.begin();

1180  for

(; xip != xil.end(); ++xip) {

1184  if

(xip == xil.end())

1188  if

(xip->subtags.empty()) {

1193  auto

xipref = xip->subtags.begin();

1194  for

(; xipref != xip->subtags.end(); ++xipref) {

1199

unique_ptr<string> reftagref;

1200

unique_ptr<string> reftagpos;

1201  auto

txip = xipref->subtags.begin();

1202  for

(; txip != xipref->subtags.end(); ++txip) {

1213  if

(txip->subtags.empty())

1217  if

(txip->subtags.empty())

1219  for

(

auto

& xipsub : txip->subtags)

1229

}

else if

(reftagref) {

1236  if

(txip != xipref->subtags.end())

1239  if

(xipref == xip->subtags.end())

1249  for

(

const auto

& xip : ibp->

xip

) {

1271  if

(ibp->

len

== 0) {

1338  if

(! entry || xil.empty())

1341  auto

xip = xil.begin();

1344  if

(xip == xil.end() || xip->subtags.empty())

1347  auto

tdbp = ret.before_begin();

1348  for

(

const auto

& txip : xip->subtags) {

1349  if

(txip.type !=

type

|| txip.subtags.empty())

1351

tdbp = ret.emplace_after(tdbp, txip.type, entry);

1352

tdbp->SetXmlData(txip.subtags);

1362  if

(! entry || xil.empty())

1365  auto

xip = xil.begin();

1366  for

(; xip != xil.end(); ++xip)

1369  if

(xip == xil.end())

1372  for

(

const auto

& xipkwd : xip->subtags) {

1375

keywords.push_back(*p);

1382  if

(! entry || xil.empty())

1385  auto

xip = xil.begin();

1386  while

(xip != xil.end() && xip->tag !=

tag

)

1389  if

(xip == xil.end() || xip->subtags.empty())

1393  for

(

const auto

& txip : xip->subtags)

1394  i

+= (txip.end - txip.start + 2);

1398  for

(

const auto

& txip : xip->subtags) {

1399  if

(txip.start >= txip.end)

1401  if

(!

buf

.empty()) {

1405  buf

.append(entry + txip.start, txip.end - txip.start);

#define ERR_FORMAT_LineTypeOrder

#define ERR_FORMAT_MissingEnd

#define INSDSEQ_ACCESSION_VERSION

#define INSDSEQ_OTHER_SEQIDS

#define INSDREFERENCE_REMARK

#define INSDSEQ_PRIMARY_ACCESSION

#define INSDSEQ_UPDATE_RELEASE

#define INSDINTERVAL_POINT

#define INSDSEQ_DEFINITION

#define INSDINTERVAL_FROM

#define INSDQUALIFIER_NAME

#define INSDSEQ_CREATE_RELEASE

#define INSDSEQ_STRANDEDNESS

#define INSDREFERENCE_PUBMED

#define INSDSEQ_FEATURE_TABLE

#define INSDFEATURE_LOCATION

#define INSDREFERENCE_AUTHORS

#define INSDREFERENCE_XREF

#define INSDQUALIFIER_VALUE

#define INSDSEQ_REFERENCES

#define INSDSEQ_SECONDARY_ACCESSIONS

#define INSDREFERENCE_POSITION

#define INSDSEQ_SOURCE_DB

#define INSDREFERENCE_TITLE

#define INSDSECONDARY_ACCN

#define INSDFEATURE_QUALS

#define INSDINTERVAL_ACCESSION

#define INSDSEQ_DATABASE_REFERENCE

#define INSDSEQ_ENTRY_VERSION

#define INSDSEQ_CREATE_DATE

#define INSDFEATURE_INTERVALS

#define INSDREFERENCE_JOURNAL

#define INSDSEQ_UPDATE_DATE

#define INSDREFERENCE_MEDLINE

#define INSDREFERENCE_CONSORTIUM

#define INSDREFERENCE_REFERENCE

DataBlk::TList TDataBlkList

std::list< std::string > TKeywordList

forward_list< XmlIndex > TXmlIndexList

int fta_atoi(string_view sv)

bool fta_StartsWith(const char *s1, string_view s2)

bool StringEqu(const char *s1, const char *s2)

void StringCpy(char *d, const char *s)

void StringNCpy(char *d, const char *s, size_t n)

size_t StringLen(const char *s)

char * StringNew(size_t sz)

void FtaInstallPrefix(int prefix, string_view name, string_view location)

#define FtaErrPost(sev, level,...)

static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)

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

int16_t Int2

2-byte (16-bit) signed integer

int32_t Int4

4-byte (32-bit) signed integer

char Char

Alias for char.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive equality of a substring with another string.

@ fConvErr_NoThrow

Do not throw an exception on error.

CRef< CDate_std > GetUpdateDate(string_view str, Parser::ESource source)

forward_list< unique_ptr< Indexblk > > TIndBlkList

#define ERR_FORMAT_XMLMissingStartTag

#define ERR_VERSION_NonDigitVerNum

#define ERR_FORMAT_XMLInvalidINSDInterval

#define ERR_VERSION_MissingVerNum

#define ERR_ACCESSION_NoAccessNum

#define ERR_FORMAT_XMLFormatError

#define ERR_FORMAT_UnexpectedEnd

#define ERR_INPUT_CannotReadEntry

#define ERR_FORMAT_XMLMissingEndTag

#define ERR_VERSION_BadVersionLine

#define ERR_VERSION_InvalidVersion

#define ERR_FORMAT_MissingField

#define ERR_FORMAT_NonAsciiChar

#define ERR_ENTRY_InvalidLineType

#define ERR_VERSION_AccessionsDontMatch

const CharType(& source)[N]

const CConstRef< CSeq_id > GetAccession(const CSeq_id_Handle &id_handle)

CRef< objects::CDate_std > date

vector< IndexblkPtr > entrylist

forward_list< XmlIndex > subtags

void check_est_sts_gss_tpa_kwds(const TKeywordList &kwds, size_t len, IndexblkPtr entry, bool tpa_check, bool &specialist_db, bool &inferential, bool &experimental, bool &assembly)

static bool XMLIndexFeatures(const char *entry, TXmlIndexList &xil)

static bool XMLKeywordsCheck(const char *entry, IndexblkPtr ibp, Parser::ESource source)

static bool XMLCheckRequiredXrefTags(const TXmlIndexList &xil)

unique_ptr< string > XMLFindTagValue(const char *entry, const TXmlIndexList &xil, Int4 tag)

static bool XMLIndexSubTags(const char *entry, XmlIndex &xip, XmlKwordBlkPtr xkbp)

static TXmlIndexList XMLIndexSameSubTags(const char *entry, const XmlIndex &xip, Int4 tag)

TDataBlkList XMLBuildRefDataBlk(char *entry, const TXmlIndexList &xil, int type)

static const char * XMLStringByTag(XmlKwordBlkPtr xkbp, Int4 tag)

static bool XMLIndexReferences(const char *entry, TXmlIndexList &xil, size_t bases)

unique_ptr< string > XMLGetTagValue(const char *entry, const XmlIndex &xip)

static bool XMLCheckRequiredRefTags(const TXmlIndexList &xil)

bool XMLIndex(ParserPtr pp)

static bool XMLTagCheck(const TXmlIndexList &xil, XmlKwordBlkPtr xkbp)

static int s_GetCharAndAdvance(Parser &config)

static Int2 XMLGetRefType(const char *reftag, size_t bases)

static bool XMLCheckRequiredIntTags(const TXmlIndexList &xil)

static bool XMLCheckRequiredTags(ParserPtr pp, IndexblkPtr ibp)

static bool XMLAccessionsCheck(ParserPtr pp, IndexblkPtr ibp, const char *entry)

static void XMLPerformIndex(ParserPtr pp)

static bool XMLCheckRequiredQualTags(const TXmlIndexList &xil)

char * XMLLoadEntry(ParserPtr pp, bool err)

static Int2 XMLGetRefTypePos(const char *reftag, size_t bases)

unique_ptr< string > XMLConcatSubTags(const char *entry, const TXmlIndexList &xil, Int4 tag, Char sep)

static bool s_IsSegment(const IndexblkPtr &ibp)

static bool XMLSameTagsCheck(const TXmlIndexList &xil, const char *name)

static string XMLRestoreSpecialCharacters(string_view s)

void XMLGetKeywords(const char *entry, const TXmlIndexList &xil, TKeywordList &keywords)

static void XMLParseVersion(IndexblkPtr ibp, const string *line)

void s_SetPointer(Parser &config, size_t offset)

static void XMLInitialEntry(IndexblkPtr ibp, const char *entry, bool accver, Parser::ESource source)

static bool s_HasInput(const Parser &config)

static bool XMLErrField(Int4 tag)

static bool XMLCheckRequiredFeatTags(const TXmlIndexList &xil)


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