浏览该文件的文档.
234 TemplateVariant call(
const std::vector<TemplateVariant> &args = std::vector<TemplateVariant>());
280 virtual void toLast() = 0;
282 virtual void toNext() = 0;
284 virtual void toPrev() = 0;
331 std::unique_ptr<Private>
p;
377 std::unique_ptr<Private>
p;
389 virtual std::unique_ptr<TemplateEscapeIntf>
clone() = 0;
404 virtual std::unique_ptr<TemplateSpacelessIntf>
clone() = 0;
408 virtual void reset() = 0;
428 virtual void push() = 0;
431 virtual void pop() = 0;
467 virtual void setSpacelessIntf(std::unique_ptr<TemplateSpacelessIntf> intf) = 0;
540 std::unique_ptr<Private>
p;
virtual ~TemplateSpacelessIntf()
TemplateStructIntfPtr toStruct()
Returns the pointer to struct referenced by this variant or 0 if this variant does not have struct ty...
std::vector< std::string > StringVector
virtual TemplateListIntf::ConstIteratorPtr createIterator() const =0
Creates a new iterator for this list.
static TemplateStructIntfPtr alloc(std::initializer_list< StructField > fields)
Creates an instance and returns a shared pointer to it
std::vector< TemplateVariant > TemplateVariantList
virtual TemplateListIntf::ConstIteratorPtr createIterator() const
Creates a new iterator for this list.
virtual TemplateVariant get(const QCString &name) const =0
Gets the value for a field name.
virtual void toPrev()=0
Moves iterator to the previous element in the list
constexpr bool isList() const
Returns TRUE if the variant holds a list value
std::unique_ptr< Private > p
TemplateVariant(FunctionDelegate delegate)
Constructs a new variant which represents a method call
std::unique_ptr< Private > p
virtual ~TemplateContext()
virtual uint count() const =0
Returns the number of elements in the list
TemplateEngine()
Create a template engine.
virtual ~TemplateListIntf()
Destroys the list
virtual void enableTabbing(bool b)=0
Setting tabbing mode on or off (for LaTeX)
virtual StringVector fields() const =0
Return the list of fields.
Class representing an 'create' tag in a template
constexpr bool isFunction() const
Returns TRUE if the variant holds a function value
Private data of a template immutable list object
TemplateImmutableList(std::initializer_list< TemplateVariant > elements)
Creates a list
QCString outputExtension() const
Returns the output extension, set via setOutputExtension()
QCString structToString() const
std::function< TemplateVariant(const std::vector< TemplateVariant > &)> FunctionDelegate
Type representing a function call in a template
TemplateVariant call(const std::vector< TemplateVariant > &args=std::vector< TemplateVariant >())
Return the result of apply this function with args.
Class representing a 'block' tag in a template
constexpr bool isBool() const
Returns TRUE if the variant holds a boolean value
virtual void render(TextStream &ts, TemplateContext *c)=0
Renders a template instance to a stream.
virtual uint count() const
Returns the number of elements in the list
Template * loadByName(const QCString &fileName, int fromLine)
Creates a new template whose contents are in a file.
virtual TemplateVariant at(uint index) const =0
Returns the element at index position index.
QCString listToString() const
virtual QCString escape(const QCString &input)=0
Returns the input after escaping certain characters
std::unique_ptr< Private > p
Abstract interface for a template.
virtual ~ConstIterator()
Destructor for the iterator
constexpr bool isWeakStruct() const
Returns TRUE if the variant holds a struct value
void setOutputExtension(const QCString &extension)
Sets the extension of the output file.
Text streaming class that buffers data.
~TemplateVariant()=default
Destroys the Variant object
void printIncludeContext(const QCString &fileName, int line) const
Prints the current template file include stack
virtual ~TemplateEscapeIntf()
virtual QCString remove(const QCString &input)=0
Returns the input after removing redundant whitespace
TemplateImmutableStruct(std::initializer_list< StructField > fields)
Creates a struct
std::shared_ptr< TemplateStructIntf > TemplateStructIntfPtr
Abstract interface for a iterator of a list.
std::unique_ptr< ConstIterator > ConstIteratorPtr
Abstract read-only interface for a context value of type list.
constexpr uint8_t index() const
Returns the index of the type held by this variant, or invalid_id() if the variant does not hold any ...
Interface used to remove redundant spaces inside a spaceless block
TemplateVariant(const char *s, bool raw=FALSE)
Constructs a new variant with a string value s.
constexpr bool valid() const
Returns true iff the Variant holds a valid type.
std::unique_ptr< TemplateContext > createContext() const
Creates a new context that can be using to render a template.
Variant type which can hold one value of a fixed set of types.
Private data of the template engine
constexpr bool isInt() const
Returns TRUE if the variant holds an integer value
Private data of a template struct object
void set(Args &&... args)
Replaces the contents of the variant container by constructing a type T calling the constructor with ...
virtual ~TemplateStructIntf()
Destroys the struct
virtual std::unique_ptr< TemplateEscapeIntf > clone()=0
Create a copy of the escape filter
virtual TemplateVariant at(uint index) const
Returns the element at index position index.
std::weak_ptr< TemplateStructIntf > TemplateStructIntfWeakPtr
TemplateVariant(TemplateListIntfPtr l)
Constructs a new variant with a list value l.
virtual void setEscapeIntf(const QCString &extension, std::unique_ptr< TemplateEscapeIntf > intf)=0
Sets the interface that will be used for escaping the result of variable expansion before writing it ...
TemplateVariant()
Constructs an invalid variant.
virtual bool current(TemplateVariant &v) const =0
TemplateVariant(TemplateStructIntfPtr s)
Constructs a new variant with a struct value s.
virtual ~Template()
Destructor
virtual void set(const QCString &name, const TemplateVariant &v)=0
Sets a value in the current scope.
constexpr bool isStruct() const
Returns TRUE if the variant holds a struct value
constexpr bool is() const
Returns true iff the variant container holds a specific type.
Abstract interface for a template context.
~TemplateEngine()
Destroys the template engine.
virtual void setOutputDirectory(const QCString &dir)=0
When files are created (i.e.
TemplateVariant(int v)
Constructs a new variant with a integer value v.
Default implementation of an immutable context value of type struct.
constexpr bool raw() const
Returns whether or not the value of the Value is raw.
bool operator==(TemplateVariant &other) const
Compares this QVariant with v and returns true if they are equal; otherwise returns false.
virtual std::unique_ptr< TemplateSpacelessIntf > clone()=0
Create a copy of the spaceless filter
virtual TemplateVariant get(const QCString &name) const
Gets the value for a field name.
virtual TemplateVariant get(const QCString &name) const =0
Gets the value for a given key
virtual ~TemplateImmutableStruct()
Destroys the struct
std::shared_ptr< TemplateListIntf > TemplateListIntfPtr
Abstract interface for a context value of type struct.
virtual void toLast()=0
Moves iterator to the last element in the list
static TemplateListIntfPtr alloc(std::initializer_list< TemplateVariant > elements)
Creates an instance and returns a shared pointer to it
QCString toString() const
Returns the variant as a string.
virtual void setSpacelessIntf(std::unique_ptr< TemplateSpacelessIntf > intf)=0
Sets the interface that will be used inside a spaceless block to remove any redundant whitespace.
constexpr bool isValid() const
Returns TRUE if the variant holds a valid value, or FALSE otherwise
virtual ~TemplateImmutableList()
Destroys the list
TemplateVariant(bool b)
Constructs a new variant with a boolean value b.
const char * typeAsString() const
Returns a string representation of this variant's type
void setRaw(bool b)
Sets whether or not the value of the Variant should be escaped or written as-is (raw).
bool toBool() const
Returns the variant as a boolean.
TemplateVariant(const std::string &s, bool raw=FALSE)
Constructs a new variant with a string value s.
Interface used to escape characters in a string
Engine to create templates and template contexts.
void enterBlock(const QCString &fileName, const QCString &blockName, int line)
TemplateVariant(const QCString &s, bool raw=FALSE)
Constructs a new variant with a string value s.
int toInt() const
Returns the variant as an integer.
virtual void push()=0
Push a new scope on the stack.
TemplateVariant & operator=(const TemplateVariant &v)=default
Assigns the value of the variant v to this variant.
void setTemplateDir(const QCString &dirName)
Sets the search directory where to look for template files
void unload(Template *t)
Indicates that template t is no longer needed.
Default implementation of a immutable context value of type list.
virtual const TemplateVariant * getRef(const QCString &name) const =0
Returns a pointer to the value corresponding to a given key.
virtual void reset()=0
Reset filter state
virtual void toNext()=0
Moves iterator to the next element in the list
virtual void toFirst()=0
Moves iterator to the first element in the list
std::pair< const std::string, TemplateVariant > StructField
TemplateListIntfPtr toList()
Returns the pointer to list referenced by this variant or 0 if this variant does not have list type.
virtual void pop()=0
Pop the current scope from the stack.
virtual StringVector fields() const
Return the list of fields.
constexpr bool isString() const
Returns TRUE if the variant holds a string value
TemplateVariant(TemplateStructIntfWeakPtr s)
Constructs a new variant with a struct value s.
constexpr Type type() const
Returns the type held by this variant
This is an alternative implementation of QCString.