OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
UpperCaseString.cpp
Go to the documentation of this file.
1//
2// Class UpperCaseString
3// This class is used to parse attributes of type string that should
4// be upper case, i.e. it returns upper case strings.
5//
6// Copyright (c) 2020, Christof Metzger-Kraus, Open Sourcerer
7// All rights reserved
8//
9// This file is part of OPAL.
10//
11// OPAL is free software: you can redistribute it and/or modify
12// it under the terms of the GNU General Public License as published by
13// the Free Software Foundation, either version 3 of the License, or
14// (at your option) any later version.
15//
16// You should have received a copy of the GNU General Public License
17// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18//
22#include "Expressions/SValue.h"
25#include "Utilities/Util.h"
26
27using namespace Expressions;
28
29namespace Attributes {
30
31 UpperCaseString::UpperCaseString(const std::string& name, const std::string& help)
32 : AttributeHandler(name, help, 0) {}
33
35
36 const std::string& UpperCaseString::getType() const {
37 static const std::string type("string");
38 return type;
39 }
40
41 void UpperCaseString::parse(Attribute& attr, Statement& stat, bool) const {
42 Attributes::setUpperCaseString(attr, parseStringValue(stat, "String value expected."));
43 }
44
45}; // namespace Attributes
Abstract base class for attribute parsers.
A representation of an Object attribute.
Definition Attribute.h:52
virtual const std::string & getType() const
Return attribute type string `‘string’'.
virtual void parse(Attribute &, Statement &, bool) const
Parse the attribute.
Interface for statements.
Definition Statement.h:37
A collection of routines to construct object Attributes and retrieve.
void setUpperCaseString(Attribute &attr, const std::string &val)
Set uppercase string value.
Representation objects and parsers for attribute expressions.
std::string parseStringValue(Statement &, const char msg[])