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

KDevelop Utility Library

  • lib
  • util
filetemplate.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2002 Bernd Gehrmann <bernd@kdevelop.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef _FILETEMPLATE_H_
21 #define _FILETEMPLATE_H_
22 
23 #include <tqstring.h>
24 
25 class KDevPlugin;
26 class TQDomDocument;
27 
36 class FileTemplate
37 {
38 public:
39 
41  typedef enum {
42  Default ,
43  Custom
45  } Policy;
46 
52  static bool exists(KDevPlugin *part, const TQString &name, Policy p = Default);
53 
59  static TQString read(KDevPlugin *part, const TQString &name, Policy p = Default);
60 
66  static TQString readFile(KDevPlugin *part, const TQString &fileName);
67 
72  static TQString makeSubstitutions(TQDomDocument &dom, const TQString &text);
73 
79  static bool copy(KDevPlugin *part, const TQString &name,
80  const TQString &dest, Policy p = Default);
85  static TQString fullPathForName(KDevPlugin *part, const TQString &name, Policy p = Default);
86 };
87 
88 #endif
FileTemplate::Default
Checks for templates in project and also for global filecreate templates.
Definition: filetemplate.h:42
FileTemplate::read
static TQString read(KDevPlugin *part, const TQString &name, Policy p=Default)
Reads a template with the given name (e.g.
Definition: filetemplate.cpp:43
FileTemplate::Policy
Policy
Policy of finding file templates.
Definition: filetemplate.h:41
FileTemplate::Custom
Checks for templates in custom directories.
Definition: filetemplate.h:43
FileTemplate::readFile
static TQString readFile(KDevPlugin *part, const TQString &fileName)
Reads a template with the given URL and makes variable substitutions (like $AUTHOR$ etc...
Definition: filetemplate.cpp:53
FileTemplate::fullPathForName
static TQString fullPathForName(KDevPlugin *part, const TQString &name, Policy p=Default)
Translates a template name into a full path, or suggests a full path for the template in the project ...
Definition: filetemplate.cpp:112
FileTemplate::makeSubstitutions
static TQString makeSubstitutions(TQDomDocument &dom, const TQString &text)
Makes variable substitutions on a text, based on a specified TQDomDocument describing a KDevelop proj...
Definition: filetemplate.cpp:66
FileTemplate
Utilities to work with file templates in the current project.
Definition: filetemplate.h:36
FileTemplate::copy
static bool copy(KDevPlugin *part, const TQString &name, const TQString &dest, Policy p=Default)
Copies a file template with the given name to the file with the name dest and - while copying - perfo...
Definition: filetemplate.cpp:90
FileTemplate::exists
static bool exists(KDevPlugin *part, const TQString &name, Policy p=Default)
Definition: filetemplate.cpp:35

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.