Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/tests/testfile.h
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 53 | public: | |||
---|---|---|---|---|---|
82 | * @code | 82 | * @code | ||
83 | * TestFile header("...", "h"); | 83 | * TestFile header("...", "h"); | ||
84 | * TestFile impl("...", "cpp", &header); | 84 | * TestFile impl("...", "cpp", &header); | ||
85 | * @endcode | 85 | * @endcode | ||
86 | */ | 86 | */ | ||
87 | TestFile(const QString& contents, const QString& fileExtension, const TestFile* base); | 87 | TestFile(const QString& contents, const QString& fileExtension, const TestFile* base); | ||
88 | 88 | | |||
89 | /** | 89 | /** | ||
90 | * Create a temporary file named @p fileName from @p contents with file extension @p extension. | ||||
91 | * | ||||
92 | * @param fileExtension the file extension without the dot. | ||||
93 | * @param fileName the name to use for the file | ||||
94 | * @param project this file will be added to the project's fileset and gets | ||||
95 | * removed from there on destruction | ||||
96 | * @param dir optional path to a (sub-) directory in which this file should | ||||
97 | * be created. The directory must exist. | ||||
98 | * | ||||
99 | * Example: | ||||
100 | * @code | ||||
101 | * TestFile file("int i = 0;", "h", "guard_test"); | ||||
102 | * @endcode | ||||
103 | */ TestFile(const QString& contents, const QString& fileExtension, const QString& fileName, | ||||
104 | KDevelop::TestProject* project = nullptr, const QString& dir = QString()); | ||||
105 | | ||||
106 | /** | ||||
90 | * Removes temporary file and cleans up. | 107 | * Removes temporary file and cleans up. | ||
91 | */ | 108 | */ | ||
92 | ~TestFile() override; | 109 | ~TestFile() override; | ||
93 | 110 | | |||
94 | /** | 111 | /** | ||
95 | * Returns the URL to this file. | 112 | * Returns the URL to this file. | ||
96 | */ | 113 | */ | ||
97 | IndexedString url() const; | 114 | IndexedString url() const; | ||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |