Working on generating string literals for inclusion in generated code.
This commit is contained in:
parent
0c3bb27e58
commit
092ed67d5e
8 changed files with 218 additions and 3 deletions
37
pglablib/codebuilder/StringLiteralRules.h
Normal file
37
pglablib/codebuilder/StringLiteralRules.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef STRINGLITERALRULES_H
|
||||
#define STRINGLITERALRULES_H
|
||||
|
||||
#include "StringEscapeRule.h"
|
||||
#include <vector>
|
||||
|
||||
class QTextStream;
|
||||
|
||||
class StringLiteralRules {
|
||||
public:
|
||||
/** What should be put in front of the string to make it a string literal
|
||||
*
|
||||
* For instance a plain char string in C this would just be a double quote "
|
||||
* But for a C++11 utf8 string literal it would be u8"
|
||||
*/
|
||||
QString m_stringStart;
|
||||
/** Similar to stringStart
|
||||
*/
|
||||
QString m_stringEnd;
|
||||
|
||||
/** If true the assumption is that the newlines
|
||||
* in the source string are not escaped so no line breaking is done.
|
||||
* However we should still get a multiline string if the source was.
|
||||
*
|
||||
* When false the assumption is that we can split the string using stringEnd,
|
||||
* stringStart and the concatOperator. There is a preference to split on whitespace.
|
||||
*/
|
||||
bool m_supportsMultiLine;
|
||||
QString m_concatOperator;
|
||||
|
||||
std::vector<StringEscapeRule> m_escapeRules;
|
||||
|
||||
void OutputString(QTextStream &stream, QString string_literal);
|
||||
};
|
||||
|
||||
|
||||
#endif // STRINGLITERALRULES_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue