tfel
Loading...
Searching...
No Matches
Token.hxx File Reference

This file declares the Token class. More...

#include <string>
#include "TFEL/Config/TFELConfig.hxx"

Classes

struct  tfel::utilities::Token
 class representing a token in a C++-like file More...

Namespaces

namespace  tfel
 the namespace tfel encloses all the TFEL project. This namespace is empty.

Functions

TFELUTILITIES_VISIBILITY_EXPORT bool tfel::utilities::isComment (const Token &)
TFELUTILITIES_VISIBILITY_EXPORT bool tfel::utilities::isRawString (const Token &)
TFELUTILITIES_VISIBILITY_EXPORT std::string tfel::utilities::getRawStringDelimiter (const Token &)
TFELUTILITIES_VISIBILITY_EXPORT std::string tfel::utilities::getContents (const Token &)

Detailed Description

This file declares the Token class.

Author
Thomas Helfer
Date
20/11/2006

Function Documentation

◆ getContents()

TFELUTILITIES_VISIBILITY_EXPORT std::string tfel::utilities::getContents ( const Token & )
Returns
the contents of the literal held by the given token: its value without the double quotes of a quoted string, without the single quotes of a character literal and without the R"delim( prefix and the )delim" suffix of a raw string literal.

The consumers which strip the quotes of a string token shall use this method instead of removing the first and last characters of the value, which truncates a raw string literal, see issue #1390.

Parameters
[in]ttoken

◆ getRawStringDelimiter()

TFELUTILITIES_VISIBILITY_EXPORT std::string tfel::utilities::getRawStringDelimiter ( const Token & )
Returns
the delimiter of the raw string literal held by the given token, that is the sequence of characters between the R" and the ( of its value, which is empty for a literal of the R"(contents)" form. An empty string is also returned if the token does not hold a raw string literal.
Parameters
[in]ttoken

◆ isComment()

TFELUTILITIES_VISIBILITY_EXPORT bool tfel::utilities::isComment ( const Token & )
Returns
true if the argument is a comment
Parameters
[in]ttoken

◆ isRawString()

TFELUTILITIES_VISIBILITY_EXPORT bool tfel::utilities::isRawString ( const Token & )
Returns
true if the token holds a raw string literal, that is a literal of the R"delim(contents)delim" form, whatever the contents of the token.
Parameters
[in]ttoken