MCPcopy Create free account
hub / github.com/CloudCompare/CloudCompare / ParseFileNames

Method ParseFileNames

qCC/ccCommandLineCommands.cpp:6886–6922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6884{}
6885
6886bool CommandSave::ParseFileNames(ccCommandLineInterface& cmd, QStringList &fileNames)
6887{
6888 //
6889 // File list is space separated, but can use quotes to include spaces in the file names
6890 //
6891 auto argument = cmd.arguments().takeFirst();
6892 while (!argument.isEmpty())
6893 {
6894 auto firstChar = argument.at(0);
6895 if (firstChar == '\'' || firstChar == '\"')
6896 {
6897 auto end = argument.indexOf(firstChar, 1);
6898 if (end == -1)
6899 {
6900 return cmd.error(QObject::tr("A file starting with %1 does not have a closing %1").arg(firstChar));
6901 }
6902
6903 fileNames.push_back(argument.mid(1, end - 1));
6904 argument.remove(0, end + 1);
6905 if (argument.startsWith(' '))
6906 {
6907 argument.remove(0, 1);
6908 }
6909 }
6910 else
6911 {
6912 auto end = argument.indexOf(' ');
6913 if (end == -1)
6914 {
6915 end = argument.length();
6916 }
6917 fileNames.push_back(argument.left(end));
6918 argument.remove(0, end + 1);
6919 }
6920 }
6921 return true;
6922}
6923
6924void CommandSave::SetFileDesc(CLEntityDesc &desc, const QString &fileName)
6925{

Callers

nothing calls this directly

Calls 7

errorMethod · 0.80
lengthMethod · 0.80
isEmptyMethod · 0.45
atMethod · 0.45
indexOfMethod · 0.45
push_backMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected