OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Title.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: Title.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.1.1.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: Title
10 // The class for the OPAL Title command.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/03/27 09:33:37 $
15 // $Author: Andreas Adelmann $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include "BasicActions/Title.h"
21 #include "Attributes/Attributes.h"
22 
23 
24 // Class Title
25 // ------------------------------------------------------------------------
26 
28  Action(1, "TITLE",
29  "The \"TITLE\" statement defines a new page title for subsequent "
30  "output.") {
32  ("STRING", "The title string");
33 
35 }
36 
37 
38 Title::Title(const std::string &name, Title *parent):
39  Action(name, parent)
40 {}
41 
42 
44 {}
45 
46 
47 Title *Title::clone(const std::string &name) {
48  return new Title(name, this);
49 }
50 
51 
53  std::string title = Attributes::getString(itsAttr[0]);
55 }
56 
57 
58 void Title::parse(Statement &statement) {
59  parseShortcut(statement);
60 }
virtual void parseShortcut(Statement &)
Parser for single-attribute commands.
Definition: Object.cpp:132
The base class for all OPAL actions.
Definition: Action.h:30
virtual Title * clone(const std::string &name)
Make clone.
Definition: Title.cpp:47
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
Definition: Object.h:214
virtual void parse(Statement &)
Parse command (special for one-attribute command).
Definition: Title.cpp:58
static OpalData * getInstance()
Definition: OpalData.cpp:209
void storeTitle(const std::string &)
Store the page title.
Definition: OpalData.cpp:696
Interface for statements.
Definition: Statement.h:38
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
Definition: Object.cpp:194
Title()
Exemplar constructor.
Definition: Title.cpp:27
const std::string name
virtual ~Title()
Definition: Title.cpp:43
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Definition: Attributes.cpp:296
The TITLE command.
Definition: Title.h:28
virtual void execute()
Execute the command.
Definition: Title.cpp:52
std::string getString(const Attribute &attr)
Get string value.
Definition: Attributes.cpp:307