NCBI C++ ToolKit
macro_worker.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef _GUI_PKG_EDIT__MACRO_WORKER__HPP_
2 #define _GUI_PKG_EDIT__MACRO_WORKER__HPP_
3 /* $Id: macro_worker.hpp 45204 2020-06-16 20:28:38Z asztalos $
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Andrea Asztalos
29  */
30 
31 #include <corelib/ncbistd.hpp>
38 
40 
42 {
43 public:
44  typedef vector<string> TVecMacroNames;
45  typedef vector<CRef<macro::CMacroRep> > TVecMacroRep;
46 
47  static const char* sm_AutofixGB;
48  static const char* sm_AutofixWGS;
49  static const char* sm_AutofixTSA;
50 
51  CMacroWorker(objects::CSeq_entry_Handle entry, CConstRef<objects::CSeq_submit> submit, ICommandProccessor* cmdProccessor)
52  : m_Seh(entry), m_SeqSubmit(submit), m_CmdProcessor(cmdProccessor) {}
53 
55 
56  bool ExecuteMacros(const vector<string>& macro_names, CNcbiOstrstream& log, bool add_user_object = false, bool resolve_vars = false);
57  bool ExecuteMacros(const string& filename, CNcbiOstrstream& log, bool add_user_object = false, bool resolve_vars = false);
58 
59  static TVecMacroNames s_GetMacroSteps(const CTempString& macro_class);
60 
61 private:
62  objects::CSeq_entry_Handle m_Seh;
65  CRef<CMacroCmdComposite> m_MacroCmd{ nullptr };
66 
69 
70  bool x_ExecuteOneMacro(macro::CMacroRep& macro_rep, macro::CMacroEngine& engine, CNcbiOstrstream& log, bool resolve_vars = false);
71  bool x_ExecuteOneMacro(const string& macro_name, macro::CMacroEngine& engine, CNcbiOstrstream& log, bool resolve_vars = false);
72 
73  void x_HandleOutput(const bool status, const bool add_user_object, const string& time);
74  bool x_ResolveVariables(CRef<macro::CMacroRep> macro_rep);
75 };
76 
78 
79 #endif // _GUI_PKG_EDIT__MACRO_WORKER__HPP_
User-defined methods of the data storage class.
ICommandProccessor * m_CmdProcessor
bool x_ExecuteOneMacro(macro::CMacroRep &macro_rep, macro::CMacroEngine &engine, CNcbiOstrstream &log, bool resolve_vars=false)
CMacroWorker(const CMacroWorker &)
static const char * sm_AutofixWGS
CMacroWorker(objects::CSeq_entry_Handle entry, CConstRef< objects::CSeq_submit > submit, ICommandProccessor *cmdProccessor)
CMacroWorker & operator=(const CMacroWorker &)
vector< string > TVecMacroNames
static const char * sm_AutofixGB
bool x_ExecuteOneMacro(const string &macro_name, macro::CMacroEngine &engine, CNcbiOstrstream &log, bool resolve_vars=false)
CConstRef< objects::CSeq_submit > m_SeqSubmit
vector< CRef< macro::CMacroRep > > TVecMacroRep
static const char * sm_AutofixTSA
objects::CSeq_entry_Handle m_Seh
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
Undo/Redo interface for editing operations.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIPKG_SEQUENCE_EDIT_EXPORT
Definition: gui_export.h:515
Macro engine for macro execution.
Modified on Sun Apr 21 03:39:04 2024 by modify_doxy.py rev. 669887