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

Go to the SVN repository for this file.

1 /* $Id: macro_word_substitute_dlg.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: Andrea Asztalos based on a file by Igor Filippov
27  *
28  * File Description:
29  *
30  */
31 #include <ncbi_pch.hpp>
37 
38 #include <wx/sizer.h>
39 #include <wx/stattext.h>
40 #include <wx/statline.h>
41 #include <wx/listbook.h>
42 #include <wx/checkbox.h>
43 #include <wx/checklst.h>
44 #include <wx/panel.h>
45 #include <wx/textctrl.h>
46 #include <wx/button.h>
47 #include <wx/bmpbuttn.h>
48 #include <wx/filedlg.h>
49 #include <wx/wupdlock.h>
50 #include <wx/artprov.h>
51 
52 
55 
56 IMPLEMENT_DYNAMIC_CLASS(CMacroWordSubstitutionDlg, wxFrame )
57 
58 BEGIN_EVENT_TABLE(CMacroWordSubstitutionDlg, wxFrame )
59 
60  EVT_TEXT( ID_MACROPATTERN, CMacroWordSubstitutionDlg::OnPatternUpdate)
61  EVT_TEXT_ENTER(ID_MACROPATTERN, CMacroWordSubstitutionDlg::OnPatternUpdate)
62  EVT_BUTTON(ID_CLEARLIST, CMacroWordSubstitutionDlg::OnClearList)
63  EVT_BUTTON( wxID_OK, CMacroWordSubstitutionDlg::OnAccept)
64  EVT_BUTTON( wxID_CANCEL, CMacroWordSubstitutionDlg::OnCancel)
65  EVT_BUTTON( ID_MACROWORDSUBST_ADD, CMacroWordSubstitutionDlg::OnAdd)
66  EVT_BUTTON( ID_MACROWORDSUBST_REMOVE, CMacroWordSubstitutionDlg::OnRemove)
67  EVT_LISTBOX_DCLICK(ID_SUBSTITUTIONLIST, CMacroWordSubstitutionDlg::OnEditSubstitutionList)
68  EVT_BUTTON( ID_MACROWORDSUBST_DELETEWORD, CMacroWordSubstitutionDlg::OnRemoveFromFile)
69  EVT_BUTTON( ID_OPENSYNFILEBTN, CMacroWordSubstitutionDlg::OnOpenFile)
71 
73 
75 {
76  Init();
77 }
78 
79 CMacroWordSubstitutionDlg::CMacroWordSubstitutionDlg( wxWindow* parent, const string& syn_filename, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
80  : m_SynonymFile(syn_filename)
81 {
82  Init();
83  Create(parent, id, caption, pos, size, style);
84 }
85 
86 bool CMacroWordSubstitutionDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
87 {
88 ////@begin CWordSubstitutionDlg creation
89  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
90  wxFrame::Create( parent, id, caption, pos, size, style );
91 
93  if (GetSizer())
94  {
95  GetSizer()->SetSizeHints(this);
96  }
97  Centre(wxBOTH|wxCENTRE_ON_SCREEN);
98 ////@end CWordSubstitutionDlg creation
99  return true;
100 }
101 
103 {
104 }
105 
107 {
108 ////@begin CWordSubstitutionDlg member initialisation
109  m_SynFile = NULL;
110  m_Pattern = NULL;
111  m_Subst = NULL;
112  m_IgnoreCase = NULL;
113  m_WholeWord = NULL;
115 ////@end CWordSubstitutionDlg member initialisation
116 }
117 
119 {
120  wxBoxSizer* itemBoxSizer1 = new wxBoxSizer(wxVERTICAL);
121  SetSizer(itemBoxSizer1);
122 
123  wxPanel* itemCBulkCmdDlg1 = new wxPanel(this, wxID_ANY);
124  itemBoxSizer1->Add(itemCBulkCmdDlg1, 1, wxGROW, 0);
125 
126  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
127  itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
128 
129  wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(0, 2, 0, 0);
130  itemBoxSizer2->Add(itemFlexGridSizer3, 1, wxGROW | wxALL, 0);
131 
132  wxStaticText* itemStaticText31 = new wxStaticText(itemCBulkCmdDlg1, wxID_STATIC, _("Substitution File"), wxDefaultPosition, wxDefaultSize, 0);
133  itemFlexGridSizer3->Add(itemStaticText31, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 3);
134 
135  itemFlexGridSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 0);
136 
137  m_SynFile = new wxTextCtrl(itemCBulkCmdDlg1, ID_MACROSYNFILE, wxEmptyString, wxDefaultPosition, wxSize(380, -1));
138  itemFlexGridSizer3->Add(m_SynFile, 1, wxEXPAND | wxALL, 5);
139 
140  wxButton* itemButton32 = new wxBitmapButton(itemCBulkCmdDlg1, ID_OPENSYNFILEBTN, wxArtProvider::GetBitmap(wxT("menu::open")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW);
141  itemButton32->SetToolTip(wxT("Choose a substitution file..."));
142  itemFlexGridSizer3->Add(itemButton32, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 3);
143 
144  wxStaticText* itemStaticText5 = new wxStaticText( itemCBulkCmdDlg1, wxID_STATIC, _("Pattern Word"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
145  itemFlexGridSizer3->Add(itemStaticText5, 0, wxALIGN_LEFT| wxALIGN_CENTER_VERTICAL | wxALL, 3);
146 
147  itemFlexGridSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 0);
148 
149  m_Pattern = new wxTextCtrl(itemCBulkCmdDlg1, ID_MACROPATTERN, wxEmptyString, wxDefaultPosition, wxSize(380, -1), 0);
150  itemFlexGridSizer3->Add(m_Pattern, 1, wxGROW | wxALL, 5);
151 
152  itemFlexGridSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 0);
153 
154  wxStaticText* itemStaticText51 = new wxStaticText(itemCBulkCmdDlg1, wxID_STATIC, _("Substitution List"), wxDefaultPosition, wxDefaultSize, 0);
155  itemFlexGridSizer3->Add(itemStaticText51, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 3);
156 
157  itemFlexGridSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 0);
158 
159  wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxVERTICAL);
160  itemFlexGridSizer3->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL, 0);
161 
162  m_Subst = new wxTextCtrl( itemCBulkCmdDlg1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(250, 90), wxTE_MULTILINE );
163  itemBoxSizer12->Add(m_Subst, 0, wxGROW|wxALL, 5);
164 
165  wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxHORIZONTAL);
166  itemBoxSizer12->Add(itemBoxSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
167 
168  m_IgnoreCase = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Ignore Case"), wxDefaultPosition, wxDefaultSize, 0 );
169  m_IgnoreCase->SetValue(true);
170  itemBoxSizer14->Add(m_IgnoreCase, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
171 
172  m_WholeWord = new wxCheckBox( itemCBulkCmdDlg1, wxID_ANY, _("Whole Word"), wxDefaultPosition, wxDefaultSize, 0 );
173  m_WholeWord->SetValue(false);
174  itemBoxSizer14->Add(m_WholeWord, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
175 
176  wxButton* clearbtn = new wxButton(itemCBulkCmdDlg1, ID_CLEARLIST, _("Clear List"), wxDefaultPosition, wxDefaultSize, 0);
177  itemBoxSizer14->Add(clearbtn, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
178 
179  wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxHORIZONTAL);
180  itemBoxSizer2->Add(itemBoxSizer17, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 0);
181 
182  wxButton* itemButton13 = new wxButton(itemCBulkCmdDlg1, ID_MACROWORDSUBST_ADD, _("Add Word Substitution"), wxDefaultPosition, wxDefaultSize, 0);
183  itemBoxSizer17->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
184 
185  wxButton* itemButton18 = new wxButton(itemCBulkCmdDlg1, ID_MACROWORDSUBST_DELETEWORD, _("Remove Word from File"), wxDefaultPosition, wxDefaultSize, 0);
186  itemButton18->SetToolTip("Removes the selected word pattern only upon clicking Accept");
187  itemBoxSizer17->Add(itemButton18, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
188 
189  m_CheckListBox = new wxCheckListBox(itemCBulkCmdDlg1, ID_SUBSTITUTIONLIST, wxDefaultPosition, wxSize(-1, 90), 0, nullptr, wxLB_HSCROLL);
190  itemBoxSizer2->Add(m_CheckListBox, 0, wxGROW|wxALL, 5);
191 
192  wxButton* itemButton14 = new wxButton( itemCBulkCmdDlg1, ID_MACROWORDSUBST_REMOVE, _("Remove Word Substitution"), wxDefaultPosition, wxDefaultSize, 0 );
193  itemBoxSizer2->Add(itemButton14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
194 
195  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
196  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL, 0);
197 
198  wxButton* itemButton15 = new wxButton( itemCBulkCmdDlg1, wxID_OK, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
199  itemBoxSizer3->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
200 
201  wxButton* itemButton16 = new wxButton( itemCBulkCmdDlg1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
202  itemBoxSizer3->Add(itemButton16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
203 
204  if (m_SynonymFile.empty()) {
205  wxWindow* w = this->GetParent();
206  while (w) {
207  CMacroFlowEditor* editor = dynamic_cast<CMacroFlowEditor*>(w);
208  if (editor) {
209  m_SynonymFile = editor->GetSynonymFile();
210  break;
211  }
212  w = w->GetParent();
213  }
214  }
215 
216  if (!m_SynonymFile.empty()) {
217  m_SynFile->ChangeValue(ToWxString(m_SynonymFile));
218  if (!NStr::EndsWith(m_SynonymFile, "/synonyms.txt") && m_SynonymFile != "synonyms.txt") {
219  macro::CMacroLib::GetInstance().StoreSynonymList(m_SynonymFile);
220  }
221  x_FetchSynonyms();
222  }
223 }
224 
226 {
227  if (subst_list && subst_list->IsSet()) {
228  for (const auto& ws : subst_list->Get()) {
229  string label = GetDescription(*ws);
230  m_LabelToSubst[label] = ws;
231  m_CheckListBox->Append(label);
232  }
233  }
234  Refresh();
235 }
236 
238 {
239  return true;
240 }
241 
242 wxBitmap CMacroWordSubstitutionDlg::GetBitmapResource( const wxString& name )
243 {
244  // Bitmap retrieval
245 ////@begin CWordSubstitutionDlg bitmap retrieval
246  wxUnusedVar(name);
247  return wxNullBitmap;
248 ////@end CWordSubstitutionDlg bitmap retrieval
249 }
250 
251 wxIcon CMacroWordSubstitutionDlg::GetIconResource( const wxString& name )
252 {
253  // Icon retrieval
254 ////@begin CWordSubstitutionDlg icon retrieval
255  wxUnusedVar(name);
256  return wxNullIcon;
257 ////@end CWordSubstitutionDlg icon retrieval
258 }
259 
261 {
262  m_SynonymMap.clear();
263  if (!m_SynonymFile.empty()) {
264  m_SynonymMap = macro::CMacroLib::GetInstance().GetSynonymList(m_SynonymFile);
265  }
266 }
267 
268 void CMacroWordSubstitutionDlg::OnOpenFile(wxCommandEvent& event)
269 {
270  wxFileDialog file_dlg(this, _("Select Substitution File"), wxEmptyString, wxEmptyString, _("All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
271  if (file_dlg.ShowModal() == wxID_OK) {
272  auto mapped_path = GetAbsolutePath(file_dlg.GetPath());
273  m_SynFile->ChangeValue(mapped_path);
274  m_SynFile->SetInsertionPoint(m_SynFile->GetLastPosition());
275 
276  string filename = ToStdString(m_SynFile->GetValue());
277  if (!NStr::EndsWith(filename, "/synonyms.txt") && filename != "synonyms.txt") {
278  macro::CMacroLib::GetInstance().StoreSynonymList(filename);
279  // update members:
280  m_SynonymFile = filename;
281  x_FetchSynonyms();
282  x_LookupWord();
283  }
284  }
285 }
286 
288 {
289  x_LookupWord();
290 }
291 
293 {
294  auto pattern = ToStdString(m_Pattern->GetValue());
295  auto it = m_SynonymMap.find(pattern);
296  m_Subst->Clear();
297  if (it != m_SynonymMap.end()) {
298  for (const auto& word_it : it->second) {
299  *m_Subst << word_it << "\n";
300  }
301  m_Subst->SetInsertionPoint(0);
302  }
303  Refresh();
304  //Note: there can be an empty pattern that has a synonym list
305 }
306 
307 void CMacroWordSubstitutionDlg::OnClearList(wxCommandEvent& event)
308 {
309  m_Subst->Clear();
310 }
311 
312 void CMacroWordSubstitutionDlg::OnUpdateAccept(wxUpdateUIEvent& event)
313 {
314  string syn_file = ToStdString(m_SynFile->GetValue());
315  bool empty_constr = m_CheckListBox->IsEmpty();
316 
317  event.Enable(empty_constr || (!empty_constr && !syn_file.empty() && syn_file != "synonyms.txt"));
318 }
319 
320 void CMacroWordSubstitutionDlg::OnAccept( wxCommandEvent& event )
321 {
323  for (auto item : m_LabelToSubst) {
324  CRef<CWord_substitution> ws = item.second;
325  word_subst->Set().push_back(ws);
326  x_UpdateMap(ws);
327  }
328 
329  if (x_UpdateSynonymFile()) {
330  wxWindow* parent = GetParent();
332  panel->AddWordSubstSet(m_SynonymFile, word_subst);
333  Close();
334  }
335 }
336 
338 {
339  auto it = m_SynonymMap.find(ws->GetWord());
340  if (it == m_SynonymMap.end()) {
341  // add new word
342  m_SynonymMap.emplace(ws->GetWord(), ws->GetSynonyms());
343  }
344  else {
345  // update existing one
346  m_SynonymMap.erase(it);
347  m_SynonymMap.emplace(ws->GetWord(), ws->GetSynonyms());
348  }
349 }
350 
352 {
353  bool ret = true;
354  if (m_SynonymMap.empty()) {
355  wxString path = ToWxString(m_SynonymFile);
356  if (wxFileExists(path)) {
357  if (!wxRemoveFile(path)) {
358  NcbiErrorBox("Failed to delete file " + m_SynonymFile);
359  ret = false;
360  }
361  }
362  }
363  else {
365  if (ostr.good()) {
366  for (const auto& it : m_SynonymMap) {
367  ostr << "word: " << it.first << endl;
368  for (const auto& syn_it : it.second) {
369  ostr << syn_it << endl;
370  }
371  ostr << endl;
372  }
373  }
374  else {
375  NcbiErrorBox("Unable to save the word substitution list to file " + m_SynonymFile);
376  ret = false;
377  }
378  }
379  return ret;
380 }
381 
382 void CMacroWordSubstitutionDlg::OnAdd( wxCommandEvent& event )
383 {
384  string pattern = NStr::TruncateSpaces(m_Pattern->GetValue().ToStdString());
385  string syn = NStr::TruncateSpaces(m_Subst->GetValue().ToStdString());
386  // Yes, an empty pattern is allowed!
387  if (syn.empty())
388  return;
389 
391  ws->SetWord(pattern);
392 
393  vector<string> lines;
394  NStr::Split(syn, "\n", lines);
395 
396  for (auto& l : lines) {
397  NStr::ReplaceInPlace(l, "\r", "");
398  string str = NStr::TruncateSpaces(l);
399  if (!str.empty())
400  ws->SetSynonyms().push_back(str);
401  }
402 
403  ws->SetCase_sensitive(!m_IgnoreCase->GetValue());
404  ws->SetWhole_word(m_WholeWord->GetValue());
405 
406  string label = GetDescription(*ws);
407  if (!label.empty()) {
408  if (m_Id < 0) {
409  // append a new item
410  m_LabelToSubst[label] = ws;
411  m_CheckListBox->Append(ToWxString(label));
412  }
413  else {
414  // update an existing item
415  string old_label = ToStdString(m_CheckListBox->GetString(m_Id));
416  m_LabelToSubst.erase(old_label);
417  m_LabelToSubst[label] = ws;
418  m_CheckListBox->SetString(m_Id, ToWxString(label));
419  }
420  Refresh();
421  }
422 }
423 
425 {
426  m_Id = event.GetInt();
427  string label = m_CheckListBox->GetString(m_Id).ToStdString();
428  const auto& ws = m_LabelToSubst[label];
429 
430  if (ws) {
431  m_Pattern->ChangeValue(ws->GetWord());
432  m_Subst->Clear();
433  for (const auto& it : ws->GetSynonyms()) {
434  *m_Subst << it << "\n";
435  }
436  m_Subst->SetInsertionPoint(0);
437  m_IgnoreCase->SetValue(!ws->GetCase_sensitive());
438  m_WholeWord->SetValue(ws->GetWhole_word());
439  }
440  Refresh();
441 }
442 
443 void CMacroWordSubstitutionDlg::OnRemove( wxCommandEvent& event )
444 {
445  wxWindowUpdateLocker noupdate(m_CheckListBox);
446  wxArrayInt checked_items;
447  m_CheckListBox->GetCheckedItems(checked_items);
448  set<int> to_delete;
449  for (size_t i = 0; i < checked_items.GetCount(); i++) {
450  int j = checked_items.Item(i);
451  string label = m_CheckListBox->GetString(j).ToStdString();
453  to_delete.insert(j);
454  }
455 
456  for (auto rit = to_delete.rbegin(); rit != to_delete.rend(); ++rit) {
457  m_CheckListBox->Delete(*rit);
458  }
459  if (checked_items.GetCount() > 0) {
460  m_Pattern->ChangeValue(wxEmptyString);
461  m_Subst->Clear();
462  }
463 
464  _ASSERT(m_CheckListBox->GetCount() == m_LabelToSubst.size());
465  Refresh();
466 }
467 
469 {
470  // remove the word pattern from the file
471  // The file is updated only when one clicks Accept
472  auto pattern = ToStdString(m_Pattern->GetValue());
473  auto it = m_SynonymMap.find(pattern);
474  if (it != m_SynonymMap.end()) {
475  m_SynonymMap.erase(it);
476  m_Pattern->ChangeValue(wxEmptyString);
477  m_Subst->Clear();
478  }
479 
480  for (auto index = 0; index < m_CheckListBox->GetCount(); ++index) {
481  string label = ToStdString(m_CheckListBox->GetString(index));
482  if (m_LabelToSubst[label]->GetWord() == pattern) {
484  m_CheckListBox->Delete(index);
485  }
486  }
487 }
488 
489 void CMacroWordSubstitutionDlg::OnCancel(wxCommandEvent& event)
490 {
491  Close();
492 }
493 
495 {
496  string str;
497  if (ws.IsSetWord() && ws.IsSetSynonyms() && !ws.GetSynonyms().empty()) {
498  str = "allow '" + ws.GetWord() + "' to be replaced by ";
499  for (const auto& it : ws.GetSynonyms()) {
500  str += "'" + it + "', ";
501  }
502  str.pop_back();
503  str.pop_back();
504 
505  if (ws.IsSetCase_sensitive() && ws.GetCase_sensitive())
506  str += ", case-sensitive";
507  if (ws.IsSetWhole_word() && ws.GetWhole_word())
508  str += ", whole word";
509  }
510  return str;
511 }
512 
User-defined methods of the data storage class.
EVT_UPDATE_UI(eCmdAlnShowMethodsDlg, CAlnMultiWidget::OnUpdateShowMethodDlg) EVT_UPDATE_UI(eCmdMethodProperties
static int trunc
Definition: array_out.c:8
const string GetSynonymFile() const
void OnAccept(wxCommandEvent &event)
void OnOpenFile(wxCommandEvent &event)
void OnRemove(wxCommandEvent &event)
void OnEditSubstitutionList(wxCommandEvent &event)
void OnAdd(wxCommandEvent &event)
static string GetDescription(const objects::CWord_substitution &ws)
void x_UpdateMap(CRef< objects::CWord_substitution > ws)
macro::CMacroLib::TStrSynList m_SynonymMap
wxIcon GetIconResource(const wxString &name)
void OnPatternUpdate(wxCommandEvent &event)
void OnUpdateAccept(wxUpdateUIEvent &event)
void OnRemoveFromFile(wxCommandEvent &event)
void OnClearList(wxCommandEvent &event)
void SetSubstitutionList(const CRef< objects::CWord_substitution_set > &subst_list)
void OnCancel(wxCommandEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
map< string, CRef< objects::CWord_substitution > > m_LabelToSubst
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Word Substitution List"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxTAB_TRAVERSAL)
virtual void AddWordSubstSet(const string &filename, CRef< objects::CWord_substitution_set > word_subst)=0
CWord_substitution_set –.
void erase(iterator pos)
Definition: map.hpp:167
size_type size() const
Definition: map.hpp:148
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
std::ofstream out("events_result.xml")
main entry point for tests
#define NULL
Definition: ncbistd.hpp:225
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
#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::ofstream CNcbiOfstream
Portable alias for ofstream.
Definition: ncbistre.hpp:500
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:3457
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:5429
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:3401
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
Definition: ncbistr.cpp:3182
static const char label[]
TWhole_word GetWhole_word(void) const
Get the Whole_word member data.
const TWord & GetWord(void) const
Get the Word member data.
bool IsSetSynonyms(void) const
Check if a value has been assigned to Synonyms data member.
const TSynonyms & GetSynonyms(void) const
Get the Synonyms member data.
bool IsSetWhole_word(void) const
Check if a value has been assigned to Whole_word data member.
Tdata & Set(void)
Assign a value to data member.
const Tdata & Get(void) const
Get the member data.
bool IsSet(void) const
Check if a value has been assigned to data member.
bool IsSetWord(void) const
Check if a value has been assigned to Word data member.
bool IsSetCase_sensitive(void) const
Check if a value has been assigned to Case_sensitive data member.
TCase_sensitive GetCase_sensitive(void) const
Get the Case_sensitive member data.
END_EVENT_TABLE()
int i
USING_SCOPE(objects)
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
static const char * str(char *buf, int n)
Definition: stats.c:84
#define _ASSERT
wxString GetAbsolutePath(const wxString &localpath)
Definition: wx_utils.cpp:188
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Thu Nov 30 04:54:14 2023 by modify_doxy.py rev. 669887