File: file.h

package info (click to toggle)
kdsoap 2.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,996 kB
  • sloc: cpp: 19,877; python: 63; makefile: 16
file content (236 lines) | stat: -rw-r--r-- 5,147 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/*
    This file is part of kdepim.

    Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/
#ifndef KODE_FILE_H
#define KODE_FILE_H

#include "class.h"
#include "code.h"
#include "license.h"
#include "variable.h"

#include <kode_export.h>

namespace KODE {

/**
 * This class represents a file.
 */
class KODE_EXPORT File
{
public:
    /**
     * Creates a new file.
     */
    File();

    /**
     * Creates a new file from @param other.
     */
    File(const File &other);

    /**
     * Destroys the file.
     */
    ~File();

    /**
     * Assignment operator.
     */
    File &operator=(const File &other);

    /**
     * Sets the filenames of both the .h and .cpp file.
     * The extensions will be automatically added.
     */
    void setFilename(const QString &baseName);

    /**
     * Sets the @param filename of the cpp file.
     */
    void setImplementationFilename(const QString &filename);

    /**
     * Sets the @param filename of the header file.
     */
    void setHeaderFilename(const QString &filename);

    /**
      Return filename of header file.
    */
    QString filenameHeader() const;

    /**
      Return filename of implementation file.
    */
    QString filenameImplementation() const;

    /**
     * Sets the name space of the file.
     */
    void setNameSpace(const QString &nameSpace);

    /**
     * Returns the name space of the file.
     */
    QString nameSpace() const;

    /**
     * Sets the @param project name of the file.
     */
    void setProject(const QString &project);

    /**
     * Returns the project name of the file.
     */
    QString project() const;

    /**
     * Add copyright statement to the file.
     *
     * @param year The year of participation.
     * @param name The name of the author.
     * @param email The email address of the author.
     */
    void addCopyright(int year, const QString &name, const QString &email);

    /**
     * Returns the list of all copyright statements.
     */
    QStringList copyrightStrings() const;

    /**
     * Sets the @param license of the file.
     */
    void setLicense(const License &license);

    /**
     * Returns the license of the file.
     */
    License license() const;

    /**
     * Adds an include to the file.
     */
    void addInclude(const QString &include);

    /**
     * Returns the list of all includes.
     */
    QStringList includes() const;

    /**
     * Inserts a class to the file.
     */
    void insertClass(const Class &newClass);

    /**
     * Returns a list of all classes.
     */
    Class::List classes() const;

    /**
     * Returns whether the file contains a class
     * with the given @param name.
     */
    bool hasClass(const QString &name);

    /**
     * Returns the class with the given @param name.
     */
    Class findClass(const QString &name);

    /**
     * Removes all classes from the file.
     */
    void clearClasses();

    /**
     * Removes all file functions from the file.
     */
    void clearFileFunctions();

    /**
     * Removes all file variables from the file.
     */
    void clearFileVariables();

    /**
     * Removes all file code from the file.
     */
    void clearCode();

    /**
     * Adds a file @param variable to the file.
     */
    void addFileVariable(const Variable &variable);

    /**
     * Returns the list of all file variables.
     */
    Variable::List fileVariables() const;

    /**
     * Adds a file @param function to the file.
     */
    void addFileFunction(const Function &function);

    /**
     * Returns the list of all file functions.
     */
    Function::List fileFunctions() const;

    /**
     * Adds a file enum to the file.
     */
    void addFileEnum(const Enum &enumValue);

    /**
     * Returns the list of all file enums.
     */
    Enum::List fileEnums() const;

    /**
     * Adds an external C declaration to the file.
     */
    void addExternCDeclaration(const QString &externalCDeclaration);

    /**
     * Returns the list of all external C declarations.
     */
    QStringList externCDeclarations() const;

    /**
     * Adds a file @param code block to the file.
     */
    void addFileCode(const Code &code);

    /**
     * Returns the file code block.
     */
    Code fileCode() const;

private:
    class Private;
    Private *d;
};
}

#endif