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

Go to the SVN repository for this file.

1 /* $Id: gb_load_option_panel.cpp 47479 2023-05-02 13:24:02Z ucko $
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:
27  *
28  * File Description:
29  *
30  */
31 
32 
33 #include <ncbi_pch.hpp>
34 
36 
41 #include <objmgr/scope.hpp>
43 #include <objmgr/util/sequence.hpp>
44 #include <util/xregexp/regexp.hpp>
45 #include <gui/objutils/utils.hpp>
46 
47 #include <wx/sizer.h>
48 #include <wx/stattext.h>
49 #include <wx/statbox.h>
50 #include <wx/icon.h>
51 #include <wx/bitmap.h>
52 #include <wx/msgdlg.h>
53 #include <wx/settings.h>
54 
55 #include <wx/txtstrm.h>
56 #include <wx/sstream.h>
57 
58 ////@begin includes
59 ////@end includes
60 
61 
64 
65 
66 IMPLEMENT_DYNAMIC_CLASS( CGenBankLoadOptionPanel, wxPanel )
67 
68 BEGIN_EVENT_TABLE( CGenBankLoadOptionPanel, wxPanel )
69 ////@begin CGenBankLoadOptionPanel event table entries
70  EVT_TEXT( ID_ACC_INPUT, CGenBankLoadOptionPanel::OnAccInputUpdated )
71 
73 
74 ////@end CGenBankLoadOptionPanel event table entries
76 
77 
79 {
80  Init();
81 }
82 
83 CGenBankLoadOptionPanel::CGenBankLoadOptionPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
84 {
85  Init();
86  Create(parent, id, pos, size, style);
87 }
88 
89 bool CGenBankLoadOptionPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
90 {
91 ////@begin CGenBankLoadOptionPanel creation
92  wxPanel::Create( parent, id, pos, size, style );
93 
95  if (GetSizer())
96  {
97  GetSizer()->SetSizeHints(this);
98  }
99  Centre();
100 ////@end CGenBankLoadOptionPanel creation
101  return true;
102 }
103 
104 
106 {
107 ////@begin CGenBankLoadOptionPanel destruction
108 ////@end CGenBankLoadOptionPanel destruction
109 }
110 
111 
113 {
114 ////@begin CGenBankLoadOptionPanel member initialisation
115  m_AccInput = NULL;
116  m_MRUWindow = NULL;
117 ////@end CGenBankLoadOptionPanel member initialisation
118  m_TokensNum = 0;
119  m_ErrNum = 0;
120 }
121 
122 
124 {
125 ////@begin CGenBankLoadOptionPanel content construction
126  CGenBankLoadOptionPanel* itemPanel1 = this;
127 
128  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
129  itemPanel1->SetSizer(itemBoxSizer2);
130 
131  wxStaticText* itemStaticText3 = new wxStaticText( itemPanel1, wxID_STATIC, _("Accessions to load:"), wxDefaultPosition, wxDefaultSize, 0 );
132  itemBoxSizer2->Add(itemStaticText3, 0, wxALIGN_LEFT|wxALL, 5);
133 
134  wxStaticText* itemStaticText4 = new wxStaticText( itemPanel1, wxID_STATIC, _("Separate accessions with spaces, tabs, commas or semicolons.\nAdd a range to accession after colon (NT_029999:5k-10k)."), wxDefaultPosition, wxDefaultSize, 0 );
135  itemBoxSizer2->Add(itemStaticText4, 0, wxGROW|wxALL, 5);
136 
137  m_AccInput = new CRichTextCtrl( itemPanel1, ID_ACC_INPUT, wxEmptyString, wxDefaultPosition, itemPanel1->ConvertDialogToPixels(wxSize(250, 100)), wxWANTS_CHARS|wxTE_RICH2|wxTE_MULTILINE );
138  itemBoxSizer2->Add(m_AccInput, 1, wxGROW|wxALL, 5);
139 
140  wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("Recently loaded accessions:"), wxDefaultPosition, wxDefaultSize, 0 );
141  itemBoxSizer2->Add(itemStaticText6, 0, wxALIGN_LEFT|wxALL, 5);
142 
143  m_MRUWindow = new CwxHtmlWindow( itemPanel1, ID_HTMLWINDOW2, wxDefaultPosition, itemPanel1->ConvertDialogToPixels(wxSize(250, 100)), wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL );
144  itemBoxSizer2->Add(m_MRUWindow, 1, wxGROW|wxALL, 5);
145 
146 ////@end CGenBankLoadOptionPanel content construction
147  m_DefStyle.SetBackgroundColour(m_AccInput->GetBackgroundColour());
148  m_ErrStyle.SetBackgroundColour(wxColour(255, 200, 200));
149  m_AccInput->SetDefaultStyle(m_DefStyle);
150 
151  m_MRUWindow->SetBorders(2);
152  m_MRUWindow->SetStandardFonts();
153 }
154 
155 
156 static string sFormatTimePeriod(CTime& t_now, CTime& t_before)
157 {
158  CTimeFormat format("b D, H:m p");
159  return t_before.ToLocalTime().AsString(format);
160 }
161 
163 {
164  CTime now(CTime::eCurrent);
165 
166  typedef TMRUAccList::TTimeToTMap TMap;
167  const TMap& map = m_AccMRUList.GetMap();
168 
169  wxStringOutputStream strstrm;
170  wxTextOutputStream os(strstrm);
171 
172  os << wxT("<html><body>");
173 
174  for( TMap::const_reverse_iterator it = map.rbegin(); it != map.rend(); ++it) {
175  time_t t = it->first;
176  CTime tm(t);
177  string acc = it->second.GetAccession();
178 
179  os << wxT("<b><a href=\"") << acc << wxT("\">") << acc
180  << wxT("</a></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
181  << wxT("<font color=#808080>last&nbsp;loaded&nbsp;&nbsp;")
182  << ToWxString(sFormatTimePeriod(now, tm)) << wxT("</font>")
183  << wxT("<br/>");
184  }
185 
186  os << wxT("</body></html>");
187 
188  m_MRUWindow->SetPage(strstrm.GetString());
189  m_MRUWindow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
190 }
191 
192 
194 {
195  return ToStdString(m_AccInput->GetValue());
196 }
197 
198 
200 {
202  m_AccInput->SetValue(ToWxString(input));
203 }
204 
205 
206 #define GB_LOADER_ERR "GenBank - Error in input"
207 
208 #define INVALID_ELEMS_MSG " elements are not valid sequence identifiers and so cannot be loaded.\
209 \nWould you like to proceed?"
210 
211 #define INVALID_INPUT "Input does not contain valid sequence identifiers."
212 
213 #define EMPTY_INPUT "Please specify one or more sequence identifiers to load!"
214 
215 
217 {
218  x_ValidateInput();
219  if(m_TokensNum > 0 && m_ErrNum == 0) {
220  return true;
221  } else {
222  if(m_TokensNum == 0) {
223  wxMessageBox(wxT(EMPTY_INPUT), wxT(GB_LOADER_ERR),
224  wxOK | wxICON_ERROR, this);
225  return false;
226  } else if(m_TokensNum == m_ErrNum) {
227  wxMessageBox(wxT(INVALID_INPUT), wxT(GB_LOADER_ERR),
228  wxOK | wxICON_ERROR, this);
229  return false;
230  } else {
232  int res = wxMessageBox(ToWxString(text), wxT(GB_LOADER_ERR),
233  wxYES_NO | wxICON_EXCLAMATION, this);
234  return res == wxYES;
235  }
236  }
237 }
238 
239 
240 static string sDelim(" \t,;\n\r");
241 const char* sRangeRegexp = "[0-9,]+[kKmM]?([-:]|\\.\\.)[0-9,]+[kKmM]?";
242 
243 static bool sParseRange(CSeq_interval& ival, const string& range)
244 {
245  string tmp = range;
246  NStr::ReplaceInPlace(tmp, ",", "");
247  NStr::ReplaceInPlace(tmp, "k", "K");
248  NStr::ReplaceInPlace(tmp, "m", "M");
249  NStr::ReplaceInPlace(tmp, "K", "000");
250  NStr::ReplaceInPlace(tmp, "M", "000000");
251 
252  list<string> pos;
253  NStr::Split(tmp, "-:.", pos, NStr::fSplit_Tokenize);
254  if (pos.size() != 2)
255  return false;
256 
257  CSeq_interval::TFrom from = 0;
258  CSeq_interval::TTo to = 0;
259  try {
260  from = NStr::StringToNumeric<CSeq_interval::TFrom>(pos.front()) - 1;
261  to = NStr::StringToNumeric<CSeq_interval::TTo>(pos.back()) - 1;
262  } catch (CException&) {
263  return false;
264  }
265 
266  ival.SetFrom(from);
267  ival.SetTo(to);
268 
269  return true;
270 }
271 
272 int CGenBankLoadOptionPanel::x_ProccessText(const string& text, vector<Token>& tokens, ICanceled& canceled)
273 {
274  tokens.clear();
275  m_Ids.clear();
276  m_NAs.clear();
277  m_GenomicAccessions.clear();
278 
279  if (canceled.IsCanceled())
280  return 0;
281 
282  vector<string> splits;
283  vector<SIZE_TYPE> split_pos;
284  NStr::Split(text, sDelim, splits, NStr::fSplit_Tokenize, &split_pos);
285  size_t size = splits.size();
286  tokens.resize(size);
287 
288  for (size_t i = 0; i < size; i++) {
289  tokens[i].m_Pos = (int)split_pos[i];
290  tokens[i].m_Size = (int)splits[i].size();
291  tokens[i].m_Valid = false;
292  }
293 
295  scope.AddDefaults();
296 
297  CRegexp regexGenAcc("GC(A|F)_\\d{9}(.\\d+)");
298 
299  size_t processed = 0;
300 
301  for (; processed < size; processed++) {
302  if (canceled.IsCanceled())
303  break;
304 
305  string s_id = splits[processed];
306 
307  string na = s_id;
308  NStr::ToUpper(na);
309 
310  if (CSeqUtils::IsNAA(na, true)) {
311  if (na.find(".") == string::npos)
312  na += ".1";
313  m_NAs.push_back(na);
314  tokens[processed].m_Valid = true;
315  continue;
316  }
317 
318  string range;
319  size_t pos = s_id.find(':');
320 
321  bool seq_id_valid = true;
322 
323  if (pos != string::npos) {
324  range = s_id.substr(pos + 1);
325  s_id = s_id.substr(0, pos);
326 
327  CRegexp re(sRangeRegexp);
328  seq_id_valid = re.IsMatch(range);
329  }
330 
331  if (seq_id_valid) {
333  CSeq_id::E_Choice acc_type = CSeq_id::GetAccType(ainfo);
334  switch (acc_type){
335  case CSeq_id::e_Local:
336  seq_id_valid = false;
337  break;
338 
339  default:
340  try {
341  CSeq_id id(s_id);
343  idh = sequence::GetId(idh, scope, sequence::eGetId_Best);
344 
345  if (idh){
346  CRef<CSeq_id> id_copy(new CSeq_id());
347 
348  id_copy->Assign(*idh.GetSeqId());
349 
350  if (range.empty())
351  m_Ids.push_back(CRef<CObject>(id_copy.GetPointer()));
352  else {
353  CRef<CSeq_loc> loc(new CSeq_loc());
354  CSeq_interval& ival = loc->SetInt();
355  ival.SetId().Assign(*id_copy);
356 
357  if (sParseRange(ival, range))
358  m_Ids.push_back(CRef<CObject>(loc.GetPointer()));
359  else
360  seq_id_valid = false;
361  }
362  }
363  else {
364  seq_id_valid = false;
365  }
366 
367  }
368  catch (CSeqIdException&){
369  if (!regexGenAcc.IsMatch(s_id))
370  seq_id_valid = false;
371  else {
372  seq_id_valid = true;
373  tokens[processed].m_GenomicAccession = true;
374  m_GenomicAccessions.push_back(s_id);
375  }
376  }
377  break;
378  }
379  }
380 
381  tokens[processed].m_Valid = seq_id_valid;
382 
383  // Debug delay
384  //::wxMilliSleep(100);
385  }
386 
387  return (int)processed;
388 }
389 
391 {
392  static bool fReentry = false;
393  if (fReentry)
394  return;
395  CBoolGuard _guard(fReentry);
396 
397  string text = ToStdString(m_AccInput->GetValue());
398 
399  m_ValidTokens.clear();
400 
401  vector<Token> tokens;
402  int processed = GUI_AsyncExec([this, &text, &tokens](ICanceled& canceled)
403  {
404  return x_ProccessText(text, tokens, canceled);
405  }, wxT("Validating accessions..."));
406 
407  m_TokensNum = (int)tokens.size();
408  m_ErrNum = m_TokensNum - processed;
409 
410  {{
411  // gtk control loses kbd focus after Freeze/Thaw
412  // restore it afterwards
413  bool restoreFocus = (wxWindow::FindFocus() == m_AccInput);
414 
415  m_AccInput->Freeze();
416  int valid_start = 0;
417  for( size_t i = 0; i < (size_t)processed; i++) {
418  if (!tokens[i].m_Valid) {
419  ++m_ErrNum;
420  int start = tokens[i].m_Pos;
421  int end = start + tokens[i].m_Size;
422  if (valid_start < start)
423  m_AccInput->SetStyle(valid_start, start, m_DefStyle);
424  m_AccInput->SetStyle(start, end, m_ErrStyle);
425  valid_start = end;
426  } else {
427  string value = text.substr(tokens[i].m_Pos, tokens[i].m_Size);
429  m_ValidTokens.push_back(value);
430  }
431  }
432  if (processed < m_TokensNum) {
433  int start = tokens[processed].m_Pos;
434  int end = (int)text.size();
435  if (valid_start < start)
436  m_AccInput->SetStyle(valid_start, start, m_DefStyle);
437  m_AccInput->SetStyle(start, end, m_ErrStyle);
438  }
439  else {
440  if (valid_start < (int)text.size())
441  m_AccInput->SetStyle(valid_start, (int)text.size(), m_DefStyle);
442  }
443  m_AccInput->Thaw();
444 
445  if (restoreFocus)
446  m_AccInput->SetFocus();
447  }}
448 }
449 
450 void CGenBankLoadOptionPanel::OnRecentAccClicked( wxHtmlLinkEvent& event )
451 {
452  const wxHtmlLinkInfo info = event.GetLinkInfo();
453  string acc = ToStdString(info.GetHref());
455  string input = GetInput();
457 
458  vector<string> tokens;
460 
461  for (vector<string>::iterator it = tokens.begin(); it != tokens.end(); ++it) {
462  if (acc == *it) {
463  tokens.erase(it);
464  tokens.push_back(acc);
465  input = NStr::Join(tokens, " ");
466  m_AccInput->SetValue(ToWxString(input));
467  return;
468  }
469  }
470 
471  if (!input.empty())
472  *m_AccInput << wxT(" ");
473 
474  *m_AccInput << ToWxString(acc);
475 }
476 
477 static const char* kPanelTag = "GenBankLoadOptionPanel";
478 static const char* kIdsInputTag = "IdsInput";
479 static const char* kMRUTag = "AccMRU";
480 
481 void CGenBankLoadOptionPanel::SaveSettings(const string& regPath)
482 {
484  CRegistryWriteView view = gui_reg.GetWriteView(regPath + "." + kPanelTag);
485 
486  string input = GetInput();
487  string encoded = NStr::URLEncode(input);
488  // do not save large texts
489  if (encoded.size() < 10000) {
490  view.Set(kIdsInputTag, encoded);
491  }
492 }
493 
495 {
496  if (m_Ids.empty() && m_NAs.empty())
497  return;
498 
500  CRegistryWriteView view = gui_reg.GetWriteView(regPath + "." + kPanelTag);
501 
502  ITERATE(vector<string>, it, m_ValidTokens)
503  m_AccMRUList.Add(*it);
504 
505  vector<string> values;
508 
511  CTime time(it->first);
512  time.ToLocalTime();
513  string s_time = time.AsString(format);
514  string accession = it->second.GetAccession();
515  values.push_back(s_time);
516  values.push_back(accession);
517  }
518  view.Set(kMRUTag, values);
519 }
520 
521 void CGenBankLoadOptionPanel::LoadSettings(const string& regPath)
522 {
524  CRegistryReadView view = gui_reg.GetReadView(regPath + "." + kPanelTag);
525 
526  string encoded = view.GetString(kIdsInputTag, kEmptyStr);
527  string input = NStr::URLDecode(encoded);
528  SetInput(input);
529 
530  // load MRU accessions
532 
533  try {
534  vector<string> values;
535  view.GetStringVec(kMRUTag, values);
538  for( size_t i = 0; i + 1 < values.size() ; ) {
539  string s_time = values[i++];
540  string accession = values[i++];
541 
542  CTime time(s_time, format);
543 
544  time_t t = time.GetTimeT();
546  }
547  } catch (const exception&) {
548  }
549 
550  x_FillMRUList();
551 }
552 
553 
554 
556 {
557  return m_Ids;
558 }
559 
561 {
562  static bool fReentry = false;
563  if (fReentry)
564  return;
565  CBoolGuard _guard(fReentry);
566 
567  long pos = m_AccInput->GetInsertionPoint();
568  m_AccInput->ChangeValue(m_AccInput->GetValue());
569  m_AccInput->SetInsertionPoint(pos);
570  x_ValidateInput();
571 }
572 
573 
575 {
576  return true;
577 }
578 
579 
580 wxBitmap CGenBankLoadOptionPanel::GetBitmapResource( const wxString& name )
581 {
582  // Bitmap retrieval
583 ////@begin CGenBankLoadOptionPanel bitmap retrieval
584  wxUnusedVar(name);
585  return wxNullBitmap;
586 ////@end CGenBankLoadOptionPanel bitmap retrieval
587 }
588 
589 
590 wxIcon CGenBankLoadOptionPanel::GetIconResource( const wxString& name )
591 {
592  // Icon retrieval
593 ////@begin CGenBankLoadOptionPanel icon retrieval
594  wxUnusedVar(name);
595  return wxNullIcon;
596 ////@end CGenBankLoadOptionPanel icon retrieval
597 }
598 
std::invoke_result< _Fty, ICanceled & >::type GUI_AsyncExec(_Fty &&_Fnarg, const wxString &msg=wxT("Accessing network..."))
Definition: async_call.hpp:130
CGenBankLoadOptionPanel.
CRegistryWriteView GetWriteView(const string &section)
get a read-write view at a particular level.
Definition: registry.cpp:462
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
CRegexp –.
Definition: regexp.hpp:70
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
string GetString(const string &key, const string &default_val=kEmptyStr) const
Definition: reg_view.cpp:246
void GetStringVec(const string &key, vector< string > &val) const
Definition: reg_view.cpp:263
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
CRichTextCtrl - a wrapper for wxRichTextCtrl that handles additional keyboard events (such as Clipboa...
CScope –.
Definition: scope.hpp:92
CSeqIdException –.
Definition: Seq_id.hpp:1001
CTimeFormat –.
Definition: ncbitime.hpp:131
void Clear()
Definition: mru_list.hpp:170
const TTimeToTMap & GetMap() const
Definition: mru_list.hpp:149
void Add(T elem, time_t time=0)
Definition: mru_list.hpp:176
CTime –.
Definition: ncbitime.hpp:296
Interface for testing cancellation request in a long lasting operation.
Definition: icanceled.hpp:51
Definition: map.hpp:338
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
static char tmp[3200]
Definition: utf8.c:42
USING_SCOPE(objects)
const char * sRangeRegexp
#define INVALID_INPUT
static string sFormatTimePeriod(CTime &t_now, CTime &t_before)
#define EMPTY_INPUT
#define GB_LOADER_ERR
#define INVALID_ELEMS_MSG
static string sDelim(" \t,;\n\r")
static bool sParseRange(CSeq_interval &ival, const string &range)
static const char * kIdsInputTag
static const char * kMRUTag
static const char * kPanelTag
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
static bool IsNAA(const string &annot, bool isStrict=false)
check if a given annotation is a named annotation accession[.version][number] when isSctrict == false...
Definition: utils.cpp:796
void SaveMruAccessions(const string &regPath)
vector< CRef< CObject > > TIdsVec
void SaveSettings(const string &regPath)
void SetInput(const string &input)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnRecentAccClicked(wxHtmlLinkEvent &event)
wxEVT_COMMAND_HTML_LINK_CLICKED event handler for ID_HTMLWINDOW2
vector< string > m_GenomicAccessions
void OnAccInputUpdated(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_UPDATED event handler for ID_ACC_INPUT
int x_ProccessText(const string &text, vector< Token > &tokens, ICanceled &canceled)
bool Create(wxWindow *parent, wxWindowID id=ID_CGENBANKLOADOPTIONPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(266, 184), long style=wxTAB_TRAVERSAL)
void LoadSettings(const string &regPath)
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
Definition: Seq_id.cpp:1634
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
Definition: Seq_id.cpp:318
CConstRef< CSeq_id > GetSeqId(void) const
EAccessionInfo
For IdentifyAccession (below)
Definition: Seq_id.hpp:220
static E_Choice GetAccType(EAccessionInfo info)
Definition: Seq_id.hpp:562
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
void SetInt(TInt &v)
Definition: Seq_loc.hpp:983
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
Definition: sequence.hpp:101
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
Definition: scope.cpp:504
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
bool IsMatch(CTempString str, TMatch flags=fMatch_default)
Check existence substring which match a specified pattern.
Definition: regexp.cpp:193
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
virtual bool IsCanceled(void) const =0
#define kEmptyStr
Definition: ncbistr.hpp:123
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
Definition: ncbistr.cpp:3461
static string URLDecode(const CTempString str, EUrlDecode flag=eUrlDec_All)
URL-decode string.
Definition: ncbistr.cpp:6214
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
Definition: ncbistr.cpp:3201
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
Definition: ncbistr.hpp:2697
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3405
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Definition: ncbistr.cpp:424
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
Definition: ncbistr.cpp:6062
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
Definition: ncbistr.hpp:2508
CTime & ToLocalTime(void)
Convert the time into local time.
Definition: ncbitime.hpp:2465
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
Definition: ncbitime.cpp:1511
time_t GetTimeT(void) const
Get time in time_t format.
Definition: ncbitime.cpp:1395
static CTimeFormat GetPredefined(EPredefined fmt, TFlags flags=fDefault)
Get predefined format.
Definition: ncbitime.cpp:388
@ eCurrent
Use current time. See also CCurrentTime.
Definition: ncbitime.hpp:300
@ eISO8601_DateTimeSec
Y-M-DTh:m:s (eg 1997-07-16T19:20:30)
Definition: ncbitime.hpp:196
void SetTo(TTo value)
Assign a value to To data member.
void SetId(TId &value)
Assign a value to Id data member.
void SetFrom(TFrom value)
Assign a value to From data member.
E_Choice
Choice variants.
Definition: Seq_id_.hpp:93
@ e_Local
local use
Definition: Seq_id_.hpp:95
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
END_EVENT_TABLE()
static int input()
int i
static void text(MDB_val *v)
Definition: mdb_dump.c:62
static MDB_envinfo info
Definition: mdb_load.c:37
#define wxT(x)
Definition: muParser.cpp:41
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
EIPRangeType t
Definition: ncbi_localip.c:101
static Format format
Definition: njn_ioutil.cpp:53
The Object manager core.
#define _ASSERT
#define ID_HTMLWINDOW2
C++ wrappers for the Perl-compatible regular expression (PCRE) library.
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Sun Apr 14 05:28:02 2024 by modify_doxy.py rev. 669887