NCBI C++ ToolKit
dblink_fieldtype.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: dblink_fieldtype.cpp 45223 2020-06-18 17:24:33Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Andrea Asztalos
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
33 
34 
36 
38 {
39  vector<string> options;
40 
41  for (int field_type = eDBLinkFieldType_Trace; field_type < eDBLinkFieldType_Unknown; field_type++) {
42  string field_name = GetLabelForType((EDBLinkFieldType)field_type);
43  options.push_back(field_name);
44  }
45 
46  return options;
47 }
48 
50 {
55  return (EDBLinkFieldType)i;
56  }
57  }
59 }
60 
62 {
63  string rval = "";
64  switch (field_type) {
66  rval = "Trace Assembly Archive";
67  break;
69  rval = "BioSample";
70  break;
72  rval = "ProbeDB";
73  break;
75  rval = "Sequence Read Archive";
76  break;
78  rval = "BioProject";
79  break;
81  rval = "Assembly";
82  break;
84  break;
85  }
86  return rval;
87 }
88 
90 {
91  if (NStr::StartsWith(orig_label, "DBLink ")) {
92  orig_label = orig_label.substr(7);
93  }
94 }
95 
97 
static EDBLinkFieldType GetTypeForLabel(string label)
static void NormalizeDBLinkFieldName(string &orig_label)
static vector< string > GetFieldNames()
static string GetLabelForType(EDBLinkFieldType field_type)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5406
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5347
static const char label[]
int i
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
Definition: pcre2_match.c:594
Modified on Fri Sep 20 14:57:19 2024 by modify_doxy.py rev. 669887