Envision
A visual programming IDE for object-oriented languages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Private Member Functions | Private Attributes
OOInteraction::StringComponents Class Reference

Classes

struct  Optional
 

Public Types

enum  UseOptional { USE , AUTO , DO_NOT_USE }
 

Public Member Functions

 StringComponents (Model::Node *node=nullptr)
 
virtual ~StringComponents ()
 
virtual QStringList components ()
 

Static Public Member Functions

template<typename T >
static void add (QStringList(*f)(T *node))
 
template<typename ... Args>
static QStringList c (Args... args)
 
template<typename E >
static Optional choose (E value)
 
template<typename E , typename ... Args>
static Optional choose (E value, E option, Optional str, Args... args)
 
static QStringList componentsForNode (Model::Node *node)
 
static void initConversions ()
 
static Optional list (Model::List *listNode, const QString &prefix, const QString &separator, const QString &postfix, bool nothingIfEmpty, bool collapse)
 
static QList< int > spaceNeededAfterUnfinishedExpressionParts (OOModel::UnfinishedOperator *e)
 Returns the indices of the positions where a space should be inserted in the string representation of this unfinished operator so as to prevent fusing of word-like parts. More...
 
static QString stringForNode (Model::Node *node)
 

Static Protected Member Functions

static Optional list (Model::List *listNode)
 

Static Private Member Functions

static void c_helper (QStringList &)
 
template<typename ... Args>
static void c_helper (QStringList &result, Optional str, Args... args)
 
static QMap< int, QStringList(*)(Model::Node *node)> & componentFunctions ()
 

Private Attributes

Model::Nodenode_
 

Member Enumeration Documentation

◆ UseOptional

Enumerator
USE 
AUTO 
DO_NOT_USE 

Constructor & Destructor Documentation

◆ StringComponents()

OOInteraction::StringComponents::StringComponents ( Model::Node node = nullptr)

◆ ~StringComponents()

OOInteraction::StringComponents::~StringComponents ( )
virtual

Member Function Documentation

◆ add()

template<typename T >
void OOInteraction::StringComponents::add ( QStringList(*)(T *node)  f)
inlinestatic

◆ c()

template<typename ... Args>
QStringList OOInteraction::StringComponents::c ( Args...  args)
static

◆ c_helper() [1/2]

void OOInteraction::StringComponents::c_helper ( QStringList &  )
inlinestaticprivate

◆ c_helper() [2/2]

template<typename ... Args>
void OOInteraction::StringComponents::c_helper ( QStringList &  result,
Optional  str,
Args...  args 
)
staticprivate

◆ choose() [1/2]

template<typename E >
StringComponents::Optional OOInteraction::StringComponents::choose ( value)
static

◆ choose() [2/2]

template<typename E , typename ... Args>
StringComponents::Optional OOInteraction::StringComponents::choose ( value,
option,
Optional  str,
Args...  args 
)
static

◆ componentFunctions()

QMap< int, QStringList(*)(Model::Node *node)> & OOInteraction::StringComponents::componentFunctions ( )
staticprivate

◆ components()

QStringList OOInteraction::StringComponents::components ( )
virtual

◆ componentsForNode()

QStringList OOInteraction::StringComponents::componentsForNode ( Model::Node node)
static

◆ initConversions()

void OOInteraction::StringComponents::initConversions ( )
static

◆ list() [1/2]

StringComponents::Optional OOInteraction::StringComponents::list ( Model::List listNode)
staticprotected

◆ list() [2/2]

StringComponents::Optional OOInteraction::StringComponents::list ( Model::List listNode,
const QString &  prefix,
const QString &  separator,
const QString &  postfix,
bool  nothingIfEmpty,
bool  collapse 
)
static

◆ spaceNeededAfterUnfinishedExpressionParts()

QList< int > OOInteraction::StringComponents::spaceNeededAfterUnfinishedExpressionParts ( OOModel::UnfinishedOperator e)
static

Returns the indices of the positions where a space should be inserted in the string representation of this unfinished operator so as to prevent fusing of word-like parts.

E.g. 'delete new' will need a space between the words

The returned list is ordered from smallest index to the largest one.

◆ stringForNode()

QString OOInteraction::StringComponents::stringForNode ( Model::Node node)
static

Member Data Documentation

◆ node_

Model::Node* OOInteraction::StringComponents::node_
private