KDevelop API Documentation

FileTemplate Class Reference

#include <filetemplate.h>

List of all members.

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

enum FileTemplate::Policy
 

Enumeration values:
Default 
Custom 

Definition at line 32 of file filetemplate.h.


Member Function Documentation

bool FileTemplate::copy KDevPlugin part,
const QString name,
const QString dest,
Policy  p = Default
[static]
 

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().

bool FileTemplate::exists KDevPlugin part,
const QString name,
Policy  p = Default
[static]
 

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().

QString FileTemplate::fullPathForName KDevPlugin part,
const QString name,
Policy  p = Default
[static]
 

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().

QString FileTemplate::read KDevPlugin part,
const QString name,
Policy  p = Default
[static]
 

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().

Referenced by copy(), and read().

QString FileTemplate::readFile KDevPlugin part,
const QString fileName
[static]
 

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:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:24 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003