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 read(), and text(). Referenced by ScriptNewFileDialog::accept(), AddFileDialog::accept(), and FileCreatePart::createNewFile(). |
|
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 fullPathForName(). Referenced by ScriptNewFileDialog::accept(), and FileCreatePart::createNewFile(). |
|
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 KDevPlugin::project(), and KDevProject::projectDirectory(). |
|
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(), and readFile(). Referenced by SubclassingDlg::accept(), copy(), ImplementationWidget::createClass(), CppNewClassDialog::ClassGenerator::gen_implementation(), and CppNewClassDialog::ClassGenerator::gen_interface(). |
|
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 DomUtil::readEntry(). Referenced by read(). |
The documentation for this class was generated from the following files:
- lib/util/filetemplate.h
- lib/util/filetemplate.cpp