FileTemplate Class Reference
#include <filetemplate.h>
Public Types | |
enum | Policy { Default, Custom } |
Static Public Member Functions | |
bool | exists (KDevPlugin *part, const QString &name, Policy p=Default) |
Returns whether a template with the given name exists in the current project. | |
QString | read (KDevPlugin *part, const QString &name, Policy p=Default) |
Reads a template with the given name (e.g. | |
QString | readFile (KDevPlugin *part, const QString &fileName) |
Reads a template with the given URL and makes variable substitutions (like $AUTHOR$ etc.) in it. | |
bool | copy (KDevPlugin *part, const QString &name, const QString &dest, Policy p=Default) |
Copies a file template with the given name to the file with the name dest and - while copying - performs variable substitutions. | |
QString | fullPathForName (KDevPlugin *part, const QString &name, Policy p=Default) |
Translates a template name into a full path, or suggests a full path for the template in the project directory if it doesn't exist. |
Member Enumeration Documentation
|
Definition at line 32 of file filetemplate.h. |
Member Function Documentation
|
Copies a file template with the given name to the file with the name dest and - while copying - performs variable substitutions.
Definition at line 80 of file filetemplate.cpp. References copy(), read(), and text(). Referenced by copy(). |
|
Returns whether a template with the given name exists in the current project. File templates are stored in the "templates" subdirectory of a project. Definition at line 35 of file filetemplate.cpp. References exists(), and fullPathForName(). Referenced by exists(). |
|
Translates a template name into a full path, or suggests a full path for the template in the project directory if it doesn't exist.
Definition at line 102 of file filetemplate.cpp. References Default, fullPathForName(), KDevPlugin::project(), and KDevProject::projectDirectory(). Referenced by exists(), fullPathForName(), and read(). |
|
Reads a template with the given name (e.g. "cpp") and makes variable substitutions (like $AUTHOR$ etc.) in it. The resulting string is returned. Definition at line 43 of file filetemplate.cpp. References fullPathForName(), read(), and readFile(). |
|
Reads a template with the given URL and makes variable substitutions (like $AUTHOR$ etc.) in it. The resulting string is returned. Definition at line 54 of file filetemplate.cpp. References KDevPlugin::projectDom(), and readFile(). Referenced by read(), and readFile(). |
The documentation for this class was generated from the following files:
- lib/util/filetemplate.h
- lib/util/filetemplate.cpp