• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Utility Library
 

KDevelop Utility Library

Public Types | Static Public Member Functions | List of all members
FileTemplate Class Reference

#include <filetemplate.h>

Public Types

enum  Policy { Default, Custom }
 

Static Public Member Functions

static bool exists (KDevPlugin *part, const TQString &name, Policy p=Default)
 
static TQString read (KDevPlugin *part, const TQString &name, Policy p=Default)
 
static TQString readFile (KDevPlugin *part, const TQString &fileName)
 
static TQString makeSubstitutions (TQDomDocument &dom, const TQString &text)
 
static bool copy (KDevPlugin *part, const TQString &name, const TQString &dest, Policy p=Default)
 
static TQString fullPathForName (KDevPlugin *part, const TQString &name, Policy p=Default)
 

Detailed Description

Utilities to work with file templates in the current project.

Definition at line 36 of file filetemplate.h.

Member Enumeration Documentation

◆ Policy

enum FileTemplate::Policy

Policy of finding file templates.

Enumerator
Default 

Checks for templates in project and also for global filecreate templates.

Custom 

Checks for templates in custom directories.

This usually means that full paths are given for FileTemplate methods.

Definition at line 41 of file filetemplate.h.

Member Function Documentation

◆ copy()

bool FileTemplate::copy ( KDevPlugin *  part,
const TQString &  name,
const TQString &  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 90 of file filetemplate.cpp.

◆ exists()

bool FileTemplate::exists ( KDevPlugin *  part,
const TQString &  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 or in application shared dirs.

Definition at line 35 of file filetemplate.cpp.

◆ fullPathForName()

TQString FileTemplate::fullPathForName ( KDevPlugin *  part,
const TQString &  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 112 of file filetemplate.cpp.

◆ makeSubstitutions()

TQString FileTemplate::makeSubstitutions ( TQDomDocument &  dom,
const TQString &  text 
)
static

Makes variable substitutions on a text, based on a specified TQDomDocument describing a KDevelop project file.

The resulting string is returned.

Definition at line 66 of file filetemplate.cpp.

◆ read()

TQString FileTemplate::read ( KDevPlugin *  part,
const TQString &  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.

◆ readFile()

TQString FileTemplate::readFile ( KDevPlugin *  part,
const TQString &  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 53 of file filetemplate.cpp.


The documentation for this class was generated from the following files:
  • filetemplate.h
  • filetemplate.cpp

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Utility Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.