NCBI C++ ToolKit
structuredcomment_panel.cpp

Search Toolkit Book for uredcomment_panel_8cpp_source

Go to the documentation of this file.
1 /* $Id: structuredcomment_panel.cpp 46585 2021-07-23 19:40:29Z 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: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
36 #include <serial/objistr.hpp>
37 #include <util/util_misc.hpp>
39 
44 
45 #include <wx/bitmap.h>
46 #include <wx/icon.h>
47 #include <wx/choice.h>
48 #include <wx/textctrl.h>
49 #include <wx/stattext.h>
50 #include <wx/valtext.h>
51 #include <wx/toplevel.h>
52 #include <wx/scrolwin.h>
53 #include <wx/checkbox.h>
54 
55 
58 
59 /*!
60  * CStructuredCommentPanel type definition
61  */
62 
63 IMPLEMENT_DYNAMIC_CLASS( CStructuredCommentPanel, wxPanel )
64 
65 
66 /*!
67  * CStructuredCommentPanel event table definition
68  */
69 
70 BEGIN_EVENT_TABLE( CStructuredCommentPanel, wxPanel )
71 
72 ////@begin CStructuredCommentPanel event table entries
73  EVT_CHOICE( ID_CHOICE11, CStructuredCommentPanel::OnChoice11Selected )
74 
76 
77 ////@end CStructuredCommentPanel event table entries
78 
80 
82 
83 
84 /*!
85  * CStructuredCommentPanel constructors
86  */
87 
89 {
90  Init();
91 }
92 
93 CStructuredCommentPanel::CStructuredCommentPanel( wxWindow* parent, CRef<CUser_object> user, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
94 {
95  Init();
96  m_User = new objects::CUser_object();
97  if (user) {
98  m_User->Assign(*user);
99  }
100  Create(parent, id, caption, pos, size, style);
101 }
102 
103 
104 /*!
105  * CStructuredCommentPanel creator
106  */
107 
108 bool CStructuredCommentPanel::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
109 {
110 ////@begin CStructuredCommentPanel creation
111  wxPanel::Create( parent, id, pos, size, style );
112 
113  CreateControls();
114  if (GetSizer())
115  {
116  GetSizer()->SetSizeHints(this);
117  }
118  Centre();
119 ////@end CStructuredCommentPanel creation
120  return true;
121 }
122 
123 
124 /*!
125  * CStructuredCommentPanel destructor
126  */
127 
129 {
130 ////@begin CStructuredCommentPanel destruction
131 ////@end CStructuredCommentPanel destruction
132 }
133 
134 
135 /*!
136  * Member initialisation
137  */
138 
140 {
141 ////@begin CStructuredCommentPanel member initialisation
146  m_Sizer = NULL;
147 ////@end CStructuredCommentPanel member initialisation
148 }
149 
150 const string CStructuredCommentPanel::sm_StructuredCommentPrefix = "StructuredCommentPrefix";
151 const string CStructuredCommentPanel::sm_StructuredCommentSuffix = "StructuredCommentSuffix";
152 
153 
155 {
156  while (NStr::StartsWith (str, "#")) {
157  str = str.substr(1);
158  }
159  while (NStr::EndsWith (str, "#")) {
160  str = str.substr(0, str.length() - 1);
161  }
162 }
163 
164 
166 {
167  if (NStr::StartsWith(str, "##")) {
168  // done
169  } else if (NStr::StartsWith (str, "#")) {
170  // add one more
171  str = "#" + str;
172  } else {
173  // add two
174  str = "##" + str;
175  }
176 
177  if (NStr::EndsWith(str, "##")) {
178  // done
179  } else if (NStr::EndsWith (str, "#")) {
180  // add one more
181  str = str + "#";
182  } else {
183  // add two
184  str = str + "##";
185  }
186 }
187 
188 
189 /*!
190  * Control creation for CStructuredCommentPanel
191  */
192 
194 {
195 ////@begin CStructuredCommentPanel content construction
196  CStructuredCommentPanel* itemPanel1 = this;
197 
198  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
199  itemPanel1->SetSizer(itemBoxSizer2);
200 
201  m_StandardCommentSizer = new wxBoxSizer(wxHORIZONTAL);
202  itemBoxSizer2->Add(m_StandardCommentSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
203 
204  m_StandardCommentTypeLabel = new wxStaticText( itemPanel1, wxID_STATIC, _("Standard Comment Type"), wxDefaultPosition, wxDefaultSize, 0 );
205  m_StandardCommentSizer->Add(m_StandardCommentTypeLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
206 
207  wxArrayString m_StandardCommentCtrlStrings;
208  m_StandardCommentCtrl = new wxChoice( itemPanel1, ID_CHOICE11, wxDefaultPosition, wxDefaultSize, m_StandardCommentCtrlStrings, 0 );
209  m_StandardCommentSizer->Add(m_StandardCommentCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
210 
211  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
212  itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_LEFT|wxALL, 5);
213 
214  wxStaticText* itemStaticText7 = new wxStaticText( itemPanel1, wxID_STATIC, _("Field Name"), wxDefaultPosition, wxSize(200, -1), 0 );
215  itemBoxSizer6->Add(itemStaticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
216 
217  wxStaticText* itemStaticText8 = new wxStaticText( itemPanel1, wxID_STATIC, _("Value"), wxDefaultPosition, wxSize(200, -1), 0 );
218  itemBoxSizer6->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
219 
220  wxHyperlinkCtrl* itemHyperlinkCtrl9 = new wxHyperlinkCtrl( itemPanel1, ID_HYPERLINKCTRL, _("Add Field"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
221  itemBoxSizer6->Add(itemHyperlinkCtrl9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
222 
223  m_ScrolledWindow = new wxScrolledWindow( itemPanel1, ID_SCROLLEDWINDOW, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
224  itemBoxSizer2->Add(m_ScrolledWindow, 1, wxGROW|wxALL, 5);
225  m_ScrolledWindow->SetScrollbars(1, 1, 0, 0);
226  m_Sizer = new wxBoxSizer(wxVERTICAL);
227  m_ScrolledWindow->SetSizer(m_Sizer);
228 
229  m_ScrolledWindow->SetMinSize(wxSize(-1, 250));
230 
231 
232 
233 ////@end CStructuredCommentPanel content construction
234 
236 
238  // add wxchoice with available comment rules
239  m_StandardCommentCtrlStrings.Add(wxEmptyString);
241  const CComment_rule& rule = **it;
242  string prefix = rule.GetPrefix();
244  m_StandardCommentCtrlStrings.Add(ToWxString(prefix));
245  }
246 
247  m_StandardCommentCtrl->Append(m_StandardCommentCtrlStrings);
248  } else {
249  }
250 }
251 
252 
253 void CStructuredCommentPanel::s_AddRow (string field_name, string field_value, bool static_fieldname, bool is_required)
254 {
255  wxBoxSizer* row_sizer = new wxBoxSizer(wxHORIZONTAL);
256  m_Sizer->Add (row_sizer, 0, wxGROW | wxALIGN_NOT|wxALL);
257  if (static_fieldname) {
258  wxStaticText* fieldNameText = new wxStaticText( m_ScrolledWindow, 0, ToWxString(field_name), wxDefaultPosition, wxSize(200, -1), 0 );
259  row_sizer->Add(fieldNameText, 0, wxALIGN_NOT|wxALL);
260  m_FieldNameCtrls.push_back(fieldNameText);
261  } else {
262  wxTextCtrl* fieldNameText = new wxTextCtrl( m_ScrolledWindow, 0, ToWxString(field_name), wxDefaultPosition, wxSize(200, -1), 0 );
263  row_sizer->Add(fieldNameText, 0, wxALIGN_NOT |wxALL);
264  m_FieldNameCtrls.push_back(fieldNameText);
265  }
266 
267  wxStaticText* star = new wxStaticText(m_ScrolledWindow, 0, is_required ? wxT("(*)") : wxT(" "), wxDefaultPosition, wxSize(20, -1), 0);
268  row_sizer->Add(star, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
269 
270  wxTextCtrl* fieldValueText = new wxTextCtrl( m_ScrolledWindow, 0, ToWxString(field_value), wxDefaultPosition, wxSize(200, -1), 0 );
271  row_sizer->Add(fieldValueText, 1, wxALIGN_NOT|wxALL);
272  fieldValueText->Bind(wxEVT_TEXT, &CStructuredCommentPanel::OnTextEntered, this);
273  m_FieldValueCtrls.push_back(fieldValueText);
274 
275 
276  if (!static_fieldname) {
277  wxHyperlinkCtrl* itemHyperLink = new CHyperlink(m_ScrolledWindow, wxID_ANY, wxT("Delete"), wxT(""));
278  itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());
279  row_sizer->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
280  }
281 
282  int row_width;
283  int row_height;
284  fieldValueText->GetClientSize(&row_width, &row_height);
285  m_TotalHeight += row_height;
286  m_ScrollRate = row_height;
287 
288 }
289 
291 {
292  if (!wxPanel::TransferDataToWindow())
293  return false;
294 
295  Freeze();
296 
297  m_Sizer->Clear(true);
298 
299  m_TotalHeight = 0;
300  m_ScrollRate = 0;
301 
302  m_FieldNameCtrls.clear();
303  m_FieldValueCtrls.clear();
304 
305  // first, find prefix and add it, save suffix for later
306  string prefix = "";
307  string suffix = "";
308  vector<string> field_names;
309  vector<string> field_values;
310  vector<bool> displayed;
311 
312  ITERATE (CUser_object::TData, it, m_User->GetData()) {
313  string field_name = "";
314  const CObject_id& obj_id = (*it)->GetLabel();
315  if ( obj_id.IsStr() ) {
316  field_name = obj_id.GetStr();
317  }
318 
319  if (NStr::EqualNocase (field_name, sm_StructuredCommentPrefix)) {
320  if ((*it)->IsSetData() && (*it)->GetData().IsStr()) {
321  prefix = (*it)->GetData().GetStr();
323  }
324  } else if (NStr::EqualNocase(field_name, sm_StructuredCommentSuffix)) {
325  if ((*it)->IsSetData() && (*it)->GetData().IsStr()) {
326  suffix = (*it)->GetData().GetStr();
328  }
329  } else {
330  field_names.push_back(field_name);
331  string value = "";
332  if ((*it)->IsSetData()) {
333  if ((*it)->GetData().IsStr()) {
334  value = (*it)->GetData().GetStr();
335  } else if ((*it)->GetData().IsInt()) {
336  value = NStr::IntToString ((*it)->GetData().GetInt());
337  }
338  }
339  field_values.push_back(value);
340  displayed.push_back(false);
341  }
342  }
343 
344  // if this is a standard comment, set the control, and list the expected fields first
345  bool use_default_layout = true;
346 
348  try {
349  const CComment_rule& rule = m_StructuredCommentRules->FindCommentRule("##" + prefix + "##");
350  m_StandardCommentCtrl->SetStringSelection(ToWxString (prefix));
351  ITERATE (CComment_rule::TFields::Tdata, field_it, rule.GetFields().Get()) {
352  bool is_required = (*field_it)->IsSetRequired() && (*field_it)->GetRequired();
353  // find existing value if we have one
354  // note - display multiple values here if present
355  bool found = false;
356  for (size_t i = 0; i < field_names.size(); i++) {
357  if (NStr::EqualNocase(field_names[i], (*field_it)->GetField_name())) {
358  s_AddRow((*field_it)->GetField_name(), field_values[i], true, is_required);
359  displayed[i] = true;
360  found = true;
361  }
362  }
363  if (!found) {
364  s_AddRow((*field_it)->GetField_name(), "", true, is_required);
365  }
366  }
367 
368  use_default_layout = false;
369  } catch (CException ) {
370  }
371  }
372 
373  if (use_default_layout) {
375  }
376 
377  for (size_t i = 0; i < field_names.size(); i++) {
378  if (!displayed[i]) {
379  s_AddRow (field_names[i], field_values[i]);
380  }
381  }
382 
383  if (use_default_layout) {
385  }
386 
387  m_ScrolledWindow->SetVirtualSize(400 + 10, m_TotalHeight);
388  m_ScrolledWindow->SetScrollRate(0, m_ScrollRate);
389  m_ScrolledWindow->FitInside();
390 
391  Layout();
392  Thaw();
393  return true;
394 }
395 
396 
398 {
399  if (!wxPanel::TransferDataFromWindow())
400  return false;
401 
402  m_User->ResetData();
403 
404  string prefix = "";
405 
406  if (m_StandardCommentCtrl) {
407  prefix = ToStdString (m_StandardCommentCtrl->GetStringSelection());
408  if (!NStr::IsBlank(prefix)) {
409  // structured comment prefix
412  }
413  }
414 
415  for (size_t i = 0; i < m_FieldValueCtrls.size(); i++) {
416  string field_name = "";
417  string field_value = "";
418 
419  /* first is either label or text */
420  wxTextCtrl* fieldNameText = dynamic_cast<wxTextCtrl*> (m_FieldNameCtrls[i]);
421  if (fieldNameText) {
422  field_name = ToStdString(fieldNameText->GetValue());
423  } else {
424  wxStaticText* staticFieldNameText = dynamic_cast<wxStaticText*> (m_FieldNameCtrls[i]);
425  if (staticFieldNameText) {
426  field_name = ToStdString (staticFieldNameText->GetLabel());
427  }
428  }
429 
430  /* second is value - could be wxText or ?*/
431  field_value = ToStdString(m_FieldValueCtrls[i]->GetValue());
432 
433  if (keep_blanks || (!NStr::IsBlank(field_name) && !NStr::IsBlank(field_value))) {
436  if (NStr::IsBlank (prefix)) {
437  s_AddPoundSigns (field_value);
438  m_User->AddField (field_name, field_value);
439  }
440  } else {
441  m_User->AddField (field_name, field_value);
442  }
443  }
444  }
445 
446  if (!NStr::IsBlank(prefix)) {
447  NStr::ReplaceInPlace (prefix, "START##", "END##");
449  }
450  return true;
451 }
452 
453 
455 {
456  return x_GetFields (false);
457 }
458 
459 
461 {
462  if (m_User)
463  return m_User;
464 
466 }
467 
468 
469 /*!
470  * Should we show tooltips?
471  */
472 
474 {
475  return true;
476 }
477 
478 /*!
479  * Get bitmap resources
480  */
481 
482 wxBitmap CStructuredCommentPanel::GetBitmapResource( const wxString& name )
483 {
484  // Bitmap retrieval
485 ////@begin CStructuredCommentPanel bitmap retrieval
486  wxUnusedVar(name);
487  return wxNullBitmap;
488 ////@end CStructuredCommentPanel bitmap retrieval
489 }
490 
491 /*!
492  * Get icon resources
493  */
494 
495 wxIcon CStructuredCommentPanel::GetIconResource( const wxString& name )
496 {
497  // Icon retrieval
498 ////@begin CStructuredCommentPanel icon retrieval
499  wxUnusedVar(name);
500  return wxNullIcon;
501 ////@end CStructuredCommentPanel icon retrieval
502 }
503 
504 
505 /*!
506  * wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL
507  */
508 
510 {
511  x_GetFields(true);
512  m_User->AddField("", "");
514 }
515 
516 
517 int CStructuredCommentPanel::x_FindRow(wxWindow* wnd, wxSizerItemList& itemList)
518 {
519  if (NULL == wnd)
520  return -1;
521 
522  int row_num = 0;
523  if (!NStr::IsBlank(ToStdString(m_StandardCommentCtrl->GetStringSelection()))) {
524  // add one because prefix field will be first in user object but will not
525  // be represented by a sizer
526  row_num ++;
527  }
528  for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it, ++row_num) {
529  wxSizer* sizer = (**it).GetSizer();
530  if (sizer && sizer->GetItem(wnd))
531  return row_num;
532  }
533 
534  return -1;
535 }
536 
537 
538 static bool s_ShouldPropagateEvent(wxWindow* w)
539 {
540  while (w) {
541  w = w->GetParent();
542  if (dynamic_cast<CMacroEditingActionPanel*>(w)) {
543  return true;
544  }
545  }
546  return false;
547 }
548 
549 void CStructuredCommentPanel::OnDelete (wxHyperlinkEvent& event)
550 {
551  wxSizerItemList& itemList = m_Sizer->GetChildren();
552 
553  int row_num = x_FindRow((wxWindow*)event.GetEventObject(), itemList);
554  if (row_num > -1) {
555  x_GetFields(true);
556  int row = 0;
557  NON_CONST_ITERATE (CUser_object::TData, it, m_User->SetData()) {
558  if (row == row_num) {
559  it = m_User->SetData().erase(it);
560  break;
561  }
562  row++;
563  }
565  if (s_ShouldPropagateEvent(this))
566  event.Skip();
567  }
568 }
569 
570 
571 /*!
572  * wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE11
573  */
574 
575 void CStructuredCommentPanel::OnChoice11Selected( wxCommandEvent& event )
576 {
577  x_GetFields(false);
579  if (s_ShouldPropagateEvent(this))
580  event.Skip();
581 }
582 
583 void CStructuredCommentPanel::OnTextEntered(wxCommandEvent& event)
584 {
585  if (s_ShouldPropagateEvent(this)) {
587  event.Skip();
588  }
589 }
590 
591 
592 void CStructuredCommentPanel::ChangeSeqdesc(const objects::CSeqdesc& desc)
593 {
595  m_User->Assign(desc.GetUser());
597 }
598 
599 
600 void CStructuredCommentPanel::UpdateSeqdesc(objects::CSeqdesc& desc)
601 {
604  desc.SetUser(*user);
605 }
606 
608 {
609  return RunningInsideNCBI();
610 }
611 
613 {
614  return RunningInsideNCBI();
615 }
616 
618 {
620  CRef<CSerialObject> so((CSerialObject*)(new objects::CUser_object));
621  so->Assign(*GetUser_object());
622  auto user = dynamic_cast<CUser_object*>(so.GetPointer());
624  if (!user->IsSetData() || user->GetData().empty()) {
625  //create dummy field so that it can be exported
627  }
628  return so;
629 }
630 
632 {
634  istr >> MSerial_AsnText >> *m_User;
636 }
637 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
static bool CleanupUserObject(CUser_object &object)
static CConstRef< CComment_set > GetCommentRules()
Base class for all serializable objects.
Definition: serialbase.hpp:150
virtual void ChangeSeqdesc(const objects::CSeqdesc &desc)
static void s_RemovePoundSigns(string &str)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
vector< wxControl * > m_FieldNameCtrls
CRef< objects::CUser_object > GetUser_object() const
static bool ShowToolTips()
Should we show tooltips?
void OnTextEntered(wxCommandEvent &event)
static const string sm_StructuredCommentPrefix
virtual void UpdateSeqdesc(objects::CSeqdesc &desc)
void s_AddRow(string field_name, string field_value, bool static_fieldname=false, bool is_required=false)
void Init()
Initialises member variables.
virtual CRef< CSerialObject > OnExport(void)
CConstRef< objects::CComment_set > m_StructuredCommentRules
bool Create(wxWindow *parent, wxWindowID id=ID_CSTRUCTUREDCOMMENTPANEL, const wxString &caption=_("StructuredCommentPanel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxTAB_TRAVERSAL)
Creation.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
static const string sm_StructuredCommentSuffix
virtual void OnImport(CNcbiIfstream &istr)
void OnHyperlinkctrlHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL
int x_FindRow(wxWindow *wnd, wxSizerItemList &itemList)
void OnChoice11Selected(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE11
CRef< objects::CUser_object > m_User
bool x_GetFields(bool keep_blanks=false)
vector< wxTextCtrl * > m_FieldValueCtrls
static void s_AddPoundSigns(string &str)
void OnDelete(wxHyperlinkEvent &event)
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
static const char * str(char *buf, int n)
Definition: stats.c:84
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define NULL
Definition: ncbistd.hpp:225
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
Definition: ncbistr.hpp:5430
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:5084
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:5412
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:5353
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
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TData & GetData(void) const
Get the Data member data.
vector< CRef< CUser_field > > TData
const TPrefix & GetPrefix(void) const
Get the Prefix member data.
list< CRef< CComment_rule > > Tdata
list< CRef< CField_rule > > Tdata
Definition: Field_set_.hpp:89
const TFields & GetFields(void) const
Get the Fields member data.
const Tdata & Get(void) const
Get the member data.
Definition: Field_set_.hpp:164
END_EVENT_TABLE()
int i
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static const char * suffix[]
Definition: pcregrep.c:408
static const char * prefix[]
Definition: pcregrep.c:405
static static static wxID_ANY
#define row(bind, expected)
Definition: string_bind.c:73
USING_SCOPE(objects)
static bool s_ShouldPropagateEvent(wxWindow *w)
#define ID_HYPERLINKCTRL
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
bool RunningInsideNCBI()
Definition: wx_utils.cpp:1335
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Wed Apr 24 14:17:03 2024 by modify_doxy.py rev. 669887