18 defaultName =
"VuoComposition";
26 defaultName =
"VuoComposition";
28 __block
int charNum = 0;
29 string (^getNextLine)(void) = ^{
33 char c = compositionAsString[charNum++];
43 __block
bool firstLine =
true;
44 bool (^getNextDoxygenLine)(
string &line) = ^(
string &line){
45 while ((line = getNextLine()) !=
"")
56 if ((line ==
" */") || (line ==
"*/"))
59 if (line.substr(0, 1) ==
"*")
61 if (line.length() > 1)
62 line = line.substr(2);
67 if (line.substr(0, 2) ==
" *")
69 if (line.length() > 2)
70 line = line.substr(3);
81 bool firstDescriptionLine =
true;
82 bool inCopyright =
false;
83 bool inLicense =
false;
84 while (getNextDoxygenLine(line))
89 if (line.substr(0, 7) ==
"@brief ")
91 name = line.substr(7);
95 if (line.substr(0, 8) ==
"@author ")
97 author = line.substr(8);
101 if (line.substr(0, 9) ==
"@version ")
103 version = line.substr(9);
107 if (line.substr(0, 21) ==
"@createdInVuoVersion ")
109 createdInVuoVersion = line.substr(21);
113 if (line.substr(0, 23) ==
"@lastSavedInVuoVersion ")
115 lastSavedInVuoVersion = line.substr(23);
119 if (line.substr(0, 10) ==
"@keywords ")
121 string keywordsAsString = line.substr(10);
123 for (
string &k : keywords)
128 if (line.substr(0, 11) ==
"@copyright ")
131 copyright = line.substr(11);
135 if (line.substr(0, 9) ==
"@license ")
139 license = line.substr(9);
149 if (line.substr(0, 12) ==
"@image icon ")
153 iconURL = line.substr(12);
157 if (line.substr(0, 14) ==
"@url homepage ")
161 homepageURL = line.substr(14);
165 if (line.substr(0, 19) ==
"@url documentation ")
169 documentationURL = line.substr(19);
173 if (line.substr(0, 8) ==
"@bundle ")
177 bundleID = line.substr(8);
181 if (line.substr(0, 13) ==
"@fxpluggroup ")
185 fxPlugGroup = line.substr(13);
189 if (line.substr(0, 5) ==
"@see ")
210 if (!firstDescriptionLine)
213 firstDescriptionLine =
false;
217 while (description.size() > 0 && description[0] ==
'\n')
218 description.erase(description.begin());
219 while (description.size() > 0 && description[description.size()-1] ==
'\n')
220 description.erase(description.end() - 1);
228 string metadataText =
234 metadataText +=
" * @brief ";
235 metadataText += name;
236 metadataText +=
"\n";
239 if (!description.empty())
242 for (
const string &descriptionLine : descriptionLines)
244 metadataText +=
" *";
245 metadataText += (descriptionLine.empty() ?
"" :
" ");
246 metadataText += descriptionLine;
247 metadataText +=
"\n";
251 metadataText +=
" *\n";
255 metadataText +=
" * @author ";
256 metadataText += author;
257 metadataText +=
"\n";
260 if (!version.empty())
262 metadataText +=
" * @version ";
263 metadataText += version;
264 metadataText +=
"\n";
267 if (!createdInVuoVersion.empty())
269 metadataText +=
" * @createdInVuoVersion ";
270 metadataText += createdInVuoVersion;
271 metadataText +=
"\n";
274 if (!lastSavedInVuoVersion.empty())
276 metadataText +=
" * @lastSavedInVuoVersion ";
277 metadataText += lastSavedInVuoVersion;
278 metadataText +=
"\n";
281 if (!keywords.empty())
283 metadataText +=
" * @keywords ";
285 metadataText +=
"\n";
290 metadataText +=
" * @copyright ";
293 bool firstCopyrightLine =
true;
294 for (
const string ©rightLine : copyrightLines)
296 if (!copyrightLine.empty())
298 if (!firstCopyrightLine)
299 metadataText +=
" * ";
300 metadataText += copyrightLine;
301 metadataText +=
"\n";
302 firstCopyrightLine =
false;
309 metadataText +=
" * @license ";
312 bool firstLicenseLine =
true;
313 for (
const string &licenseLine : licenseLines)
315 if (!licenseLine.empty())
317 if (!firstLicenseLine)
318 metadataText +=
" * ";
319 metadataText += licenseLine;
320 metadataText +=
"\n";
321 firstLicenseLine =
false;
326 if (!iconURL.empty())
328 metadataText +=
" * @image icon ";
329 metadataText += iconURL;
330 metadataText +=
"\n";
333 if (!homepageURL.empty())
335 metadataText +=
" * @url homepage ";
336 metadataText += homepageURL;
337 metadataText +=
"\n";
340 if (!documentationURL.empty())
342 metadataText +=
" * @url documentation ";
343 metadataText += documentationURL;
344 metadataText +=
"\n";
347 if (!bundleID.empty())
349 metadataText +=
" * @bundle ";
350 metadataText += bundleID;
351 metadataText +=
"\n";
354 if (!fxPlugGroup.empty())
356 metadataText +=
" * @fxpluggroup ";
357 metadataText += fxPlugGroup;
358 metadataText +=
"\n";
362 " * @see This is a Vuo Composition source code file. See https://vuo.org for further information.\n"
381 this->defaultName = defaultName;
389 return name.empty() ? defaultName : name;
413 this->author = author;
429 this->description = description;
445 this->keywords = keywords;
461 this->copyright = copyright;
477 this->license = license;
493 this->version = version;
509 this->createdInVuoVersion = version;
517 return createdInVuoVersion;
525 this->lastSavedInVuoVersion = version;
533 return lastSavedInVuoVersion;
557 this->homepageURL = url;
573 this->documentationURL = url;
581 return documentationURL;
605 this->fxPlugGroup = group;
621 this->categories = categories;