cmVisualStudioSlnParser.cxx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmVisualStudioSlnParser.h"
  4. #include "cmSystemTools.h"
  5. #include "cmVisualStudioSlnData.h"
  6. #include "cmsys/FStream.hxx"
  7. #include <cassert>
  8. #include <stack>
  9. namespace {
  10. enum LineFormat
  11. {
  12. LineMultiValueTag,
  13. LineSingleValueTag,
  14. LineKeyValuePair,
  15. LineVerbatim
  16. };
  17. }
  18. class cmVisualStudioSlnParser::ParsedLine
  19. {
  20. public:
  21. bool IsComment() const;
  22. bool IsKeyValuePair() const;
  23. const std::string& GetTag() const { return this->Tag; }
  24. const std::string& GetArg() const { return this->Arg.first; }
  25. std::string GetArgVerbatim() const;
  26. size_t GetValueCount() const { return this->Values.size(); }
  27. const std::string& GetValue(size_t idxValue) const;
  28. std::string GetValueVerbatim(size_t idxValue) const;
  29. void SetTag(const std::string& tag) { this->Tag = tag; }
  30. void SetArg(const std::string& arg) { this->Arg = StringData(arg, false); }
  31. void SetQuotedArg(const std::string& arg)
  32. {
  33. this->Arg = StringData(arg, true);
  34. }
  35. void AddValue(const std::string& value)
  36. {
  37. this->Values.push_back(StringData(value, false));
  38. }
  39. void AddQuotedValue(const std::string& value)
  40. {
  41. this->Values.push_back(StringData(value, true));
  42. }
  43. void CopyVerbatim(const std::string& line) { this->Tag = line; }
  44. private:
  45. typedef std::pair<std::string, bool> StringData;
  46. std::string Tag;
  47. StringData Arg;
  48. std::vector<StringData> Values;
  49. static const std::string BadString;
  50. static const std::string Quote;
  51. };
  52. const std::string cmVisualStudioSlnParser::ParsedLine::BadString;
  53. const std::string cmVisualStudioSlnParser::ParsedLine::Quote("\"");
  54. bool cmVisualStudioSlnParser::ParsedLine::IsComment() const
  55. {
  56. assert(!this->Tag.empty());
  57. return (this->Tag[0] == '#');
  58. }
  59. bool cmVisualStudioSlnParser::ParsedLine::IsKeyValuePair() const
  60. {
  61. assert(!this->Tag.empty());
  62. return this->Arg.first.empty() && this->Values.size() == 1;
  63. }
  64. std::string cmVisualStudioSlnParser::ParsedLine::GetArgVerbatim() const
  65. {
  66. if (this->Arg.second)
  67. return Quote + this->Arg.first + Quote;
  68. else
  69. return this->Arg.first;
  70. }
  71. const std::string& cmVisualStudioSlnParser::ParsedLine::GetValue(
  72. size_t idxValue) const
  73. {
  74. if (idxValue < this->Values.size())
  75. return this->Values[idxValue].first;
  76. else
  77. return BadString;
  78. }
  79. std::string cmVisualStudioSlnParser::ParsedLine::GetValueVerbatim(
  80. size_t idxValue) const
  81. {
  82. if (idxValue < this->Values.size()) {
  83. const StringData& data = this->Values[idxValue];
  84. if (data.second)
  85. return Quote + data.first + Quote;
  86. else
  87. return data.first;
  88. } else
  89. return BadString;
  90. }
  91. class cmVisualStudioSlnParser::State
  92. {
  93. public:
  94. explicit State(DataGroupSet requestedData);
  95. size_t GetCurrentLine() const { return this->CurrentLine; }
  96. bool ReadLine(std::istream& input, std::string& line);
  97. LineFormat NextLineFormat() const;
  98. bool Process(const cmVisualStudioSlnParser::ParsedLine& line,
  99. cmSlnData& output, cmVisualStudioSlnParser::ResultData& result);
  100. bool Finished(cmVisualStudioSlnParser::ResultData& result);
  101. private:
  102. enum FileState
  103. {
  104. FileStateStart,
  105. FileStateTopLevel,
  106. FileStateProject,
  107. FileStateProjectDependencies,
  108. FileStateGlobal,
  109. FileStateSolutionConfigurations,
  110. FileStateProjectConfigurations,
  111. FileStateSolutionFilters,
  112. FileStateGlobalSection,
  113. FileStateIgnore
  114. };
  115. std::stack<FileState> Stack;
  116. std::string EndIgnoreTag;
  117. DataGroupSet RequestedData;
  118. size_t CurrentLine;
  119. void IgnoreUntilTag(const std::string& endTag);
  120. };
  121. cmVisualStudioSlnParser::State::State(DataGroupSet requestedData)
  122. : RequestedData(requestedData)
  123. , CurrentLine(0)
  124. {
  125. if (this->RequestedData.test(DataGroupProjectDependenciesBit))
  126. this->RequestedData.set(DataGroupProjectsBit);
  127. this->Stack.push(FileStateStart);
  128. }
  129. bool cmVisualStudioSlnParser::State::ReadLine(std::istream& input,
  130. std::string& line)
  131. {
  132. ++this->CurrentLine;
  133. return !std::getline(input, line).fail();
  134. }
  135. LineFormat cmVisualStudioSlnParser::State::NextLineFormat() const
  136. {
  137. switch (this->Stack.top()) {
  138. case FileStateStart:
  139. return LineVerbatim;
  140. case FileStateTopLevel:
  141. return LineMultiValueTag;
  142. case FileStateProject:
  143. return LineSingleValueTag;
  144. case FileStateProjectDependencies:
  145. return LineKeyValuePair;
  146. case FileStateGlobal:
  147. return LineSingleValueTag;
  148. case FileStateSolutionConfigurations:
  149. return LineKeyValuePair;
  150. case FileStateProjectConfigurations:
  151. return LineKeyValuePair;
  152. case FileStateSolutionFilters:
  153. return LineKeyValuePair;
  154. case FileStateGlobalSection:
  155. return LineKeyValuePair;
  156. case FileStateIgnore:
  157. return LineVerbatim;
  158. default:
  159. assert(false);
  160. return LineVerbatim;
  161. }
  162. }
  163. bool cmVisualStudioSlnParser::State::Process(
  164. const cmVisualStudioSlnParser::ParsedLine& line, cmSlnData& output,
  165. cmVisualStudioSlnParser::ResultData& result)
  166. {
  167. assert(!line.IsComment());
  168. switch (this->Stack.top()) {
  169. case FileStateStart:
  170. if (!cmSystemTools::StringStartsWith(
  171. line.GetTag().c_str(), "Microsoft Visual Studio Solution File")) {
  172. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  173. return false;
  174. }
  175. this->Stack.pop();
  176. this->Stack.push(FileStateTopLevel);
  177. break;
  178. case FileStateTopLevel:
  179. if (line.GetTag().compare("Project") == 0) {
  180. if (line.GetValueCount() != 3) {
  181. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  182. return false;
  183. }
  184. if (this->RequestedData.test(DataGroupProjectsBit)) {
  185. if (!output.AddProject(line.GetValue(2), line.GetValue(0),
  186. line.GetValue(1))) {
  187. result.SetError(ResultErrorInputData, this->GetCurrentLine());
  188. return false;
  189. }
  190. this->Stack.push(FileStateProject);
  191. } else
  192. this->IgnoreUntilTag("EndProject");
  193. } else if (line.GetTag().compare("Global") == 0)
  194. this->Stack.push(FileStateGlobal);
  195. else {
  196. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  197. return false;
  198. }
  199. break;
  200. case FileStateProject:
  201. if (line.GetTag().compare("EndProject") == 0)
  202. this->Stack.pop();
  203. else if (line.GetTag().compare("ProjectSection") == 0) {
  204. if (line.GetArg().compare("ProjectDependencies") == 0 &&
  205. line.GetValue(0).compare("postProject") == 0) {
  206. if (this->RequestedData.test(DataGroupProjectDependenciesBit))
  207. this->Stack.push(FileStateProjectDependencies);
  208. else
  209. this->IgnoreUntilTag("EndProjectSection");
  210. } else
  211. this->IgnoreUntilTag("EndProjectSection");
  212. } else {
  213. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  214. return false;
  215. }
  216. break;
  217. case FileStateProjectDependencies:
  218. if (line.GetTag().compare("EndProjectSection") == 0)
  219. this->Stack.pop();
  220. else if (line.IsKeyValuePair())
  221. // implement dependency storing here, once needed
  222. ;
  223. else {
  224. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  225. return false;
  226. }
  227. break;
  228. case FileStateGlobal:
  229. if (line.GetTag().compare("EndGlobal") == 0)
  230. this->Stack.pop();
  231. else if (line.GetTag().compare("GlobalSection") == 0) {
  232. if (line.GetArg().compare("SolutionConfigurationPlatforms") == 0 &&
  233. line.GetValue(0).compare("preSolution") == 0) {
  234. if (this->RequestedData.test(DataGroupSolutionConfigurationsBit))
  235. this->Stack.push(FileStateSolutionConfigurations);
  236. else
  237. this->IgnoreUntilTag("EndGlobalSection");
  238. } else if (line.GetArg().compare("ProjectConfigurationPlatforms") ==
  239. 0 &&
  240. line.GetValue(0).compare("postSolution") == 0) {
  241. if (this->RequestedData.test(DataGroupProjectConfigurationsBit))
  242. this->Stack.push(FileStateProjectConfigurations);
  243. else
  244. this->IgnoreUntilTag("EndGlobalSection");
  245. } else if (line.GetArg().compare("NestedProjects") == 0 &&
  246. line.GetValue(0).compare("preSolution") == 0) {
  247. if (this->RequestedData.test(DataGroupSolutionFiltersBit))
  248. this->Stack.push(FileStateSolutionFilters);
  249. else
  250. this->IgnoreUntilTag("EndGlobalSection");
  251. } else if (this->RequestedData.test(DataGroupGenericGlobalSectionsBit))
  252. this->Stack.push(FileStateGlobalSection);
  253. else
  254. this->IgnoreUntilTag("EndGlobalSection");
  255. } else {
  256. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  257. return false;
  258. }
  259. break;
  260. case FileStateSolutionConfigurations:
  261. if (line.GetTag().compare("EndGlobalSection") == 0)
  262. this->Stack.pop();
  263. else if (line.IsKeyValuePair())
  264. // implement configuration storing here, once needed
  265. ;
  266. else {
  267. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  268. return false;
  269. }
  270. break;
  271. case FileStateProjectConfigurations:
  272. if (line.GetTag().compare("EndGlobalSection") == 0)
  273. this->Stack.pop();
  274. else if (line.IsKeyValuePair())
  275. // implement configuration storing here, once needed
  276. ;
  277. else {
  278. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  279. return false;
  280. }
  281. break;
  282. case FileStateSolutionFilters:
  283. if (line.GetTag().compare("EndGlobalSection") == 0)
  284. this->Stack.pop();
  285. else if (line.IsKeyValuePair())
  286. // implement filter storing here, once needed
  287. ;
  288. else {
  289. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  290. return false;
  291. }
  292. break;
  293. case FileStateGlobalSection:
  294. if (line.GetTag().compare("EndGlobalSection") == 0)
  295. this->Stack.pop();
  296. else if (line.IsKeyValuePair())
  297. // implement section storing here, once needed
  298. ;
  299. else {
  300. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  301. return false;
  302. }
  303. break;
  304. case FileStateIgnore:
  305. if (line.GetTag() == this->EndIgnoreTag) {
  306. this->Stack.pop();
  307. this->EndIgnoreTag.clear();
  308. }
  309. break;
  310. default:
  311. result.SetError(ResultErrorBadInternalState, this->GetCurrentLine());
  312. return false;
  313. }
  314. return true;
  315. }
  316. bool cmVisualStudioSlnParser::State::Finished(
  317. cmVisualStudioSlnParser::ResultData& result)
  318. {
  319. if (this->Stack.top() != FileStateTopLevel) {
  320. result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
  321. return false;
  322. }
  323. result.Result = ResultOK;
  324. return true;
  325. }
  326. void cmVisualStudioSlnParser::State::IgnoreUntilTag(const std::string& endTag)
  327. {
  328. this->Stack.push(FileStateIgnore);
  329. this->EndIgnoreTag = endTag;
  330. }
  331. cmVisualStudioSlnParser::ResultData::ResultData()
  332. : Result(ResultOK)
  333. , ResultLine(0)
  334. {
  335. }
  336. void cmVisualStudioSlnParser::ResultData::Clear()
  337. {
  338. *this = ResultData();
  339. }
  340. void cmVisualStudioSlnParser::ResultData::SetError(ParseResult error,
  341. size_t line)
  342. {
  343. this->Result = error;
  344. this->ResultLine = line;
  345. }
  346. const cmVisualStudioSlnParser::DataGroupSet
  347. cmVisualStudioSlnParser::DataGroupProjects(
  348. 1 << cmVisualStudioSlnParser::DataGroupProjectsBit);
  349. const cmVisualStudioSlnParser::DataGroupSet
  350. cmVisualStudioSlnParser::DataGroupProjectDependencies(
  351. 1 << cmVisualStudioSlnParser::DataGroupProjectDependenciesBit);
  352. const cmVisualStudioSlnParser::DataGroupSet
  353. cmVisualStudioSlnParser::DataGroupSolutionConfigurations(
  354. 1 << cmVisualStudioSlnParser::DataGroupSolutionConfigurationsBit);
  355. const cmVisualStudioSlnParser::DataGroupSet
  356. cmVisualStudioSlnParser::DataGroupProjectConfigurations(
  357. 1 << cmVisualStudioSlnParser::DataGroupProjectConfigurationsBit);
  358. const cmVisualStudioSlnParser::DataGroupSet
  359. cmVisualStudioSlnParser::DataGroupSolutionFilters(
  360. 1 << cmVisualStudioSlnParser::DataGroupSolutionFiltersBit);
  361. const cmVisualStudioSlnParser::DataGroupSet
  362. cmVisualStudioSlnParser::DataGroupGenericGlobalSections(
  363. 1 << cmVisualStudioSlnParser::DataGroupGenericGlobalSectionsBit);
  364. const cmVisualStudioSlnParser::DataGroupSet
  365. cmVisualStudioSlnParser::DataGroupAll(~0);
  366. bool cmVisualStudioSlnParser::Parse(std::istream& input, cmSlnData& output,
  367. DataGroupSet dataGroups)
  368. {
  369. this->LastResult.Clear();
  370. if (!this->IsDataGroupSetSupported(dataGroups)) {
  371. this->LastResult.SetError(ResultErrorUnsupportedDataGroup, 0);
  372. return false;
  373. }
  374. State state(dataGroups);
  375. return this->ParseImpl(input, output, state);
  376. }
  377. bool cmVisualStudioSlnParser::ParseFile(const std::string& file,
  378. cmSlnData& output,
  379. DataGroupSet dataGroups)
  380. {
  381. this->LastResult.Clear();
  382. if (!this->IsDataGroupSetSupported(dataGroups)) {
  383. this->LastResult.SetError(ResultErrorUnsupportedDataGroup, 0);
  384. return false;
  385. }
  386. cmsys::ifstream f(file.c_str());
  387. if (!f) {
  388. this->LastResult.SetError(ResultErrorOpeningInput, 0);
  389. return false;
  390. }
  391. State state(dataGroups);
  392. return this->ParseImpl(f, output, state);
  393. }
  394. cmVisualStudioSlnParser::ParseResult cmVisualStudioSlnParser::GetParseResult()
  395. const
  396. {
  397. return this->LastResult.Result;
  398. }
  399. size_t cmVisualStudioSlnParser::GetParseResultLine() const
  400. {
  401. return this->LastResult.ResultLine;
  402. }
  403. bool cmVisualStudioSlnParser::GetParseHadBOM() const
  404. {
  405. return this->LastResult.HadBOM;
  406. }
  407. bool cmVisualStudioSlnParser::IsDataGroupSetSupported(
  408. DataGroupSet dataGroups) const
  409. {
  410. return (dataGroups & DataGroupProjects) == dataGroups;
  411. // only supporting DataGroupProjects for now
  412. }
  413. bool cmVisualStudioSlnParser::ParseImpl(std::istream& input, cmSlnData& output,
  414. State& state)
  415. {
  416. std::string line;
  417. // Does the .sln start with a Byte Order Mark?
  418. if (!this->ParseBOM(input, line, state))
  419. return false;
  420. do {
  421. line = cmSystemTools::TrimWhitespace(line);
  422. if (line.empty())
  423. continue;
  424. ParsedLine parsedLine;
  425. switch (state.NextLineFormat()) {
  426. case LineMultiValueTag:
  427. if (!this->ParseMultiValueTag(line, parsedLine, state))
  428. return false;
  429. break;
  430. case LineSingleValueTag:
  431. if (!this->ParseSingleValueTag(line, parsedLine, state))
  432. return false;
  433. break;
  434. case LineKeyValuePair:
  435. if (!this->ParseKeyValuePair(line, parsedLine, state))
  436. return false;
  437. break;
  438. case LineVerbatim:
  439. parsedLine.CopyVerbatim(line);
  440. break;
  441. }
  442. if (parsedLine.IsComment())
  443. continue;
  444. if (!state.Process(parsedLine, output, this->LastResult))
  445. return false;
  446. } while (state.ReadLine(input, line));
  447. return state.Finished(this->LastResult);
  448. }
  449. bool cmVisualStudioSlnParser::ParseBOM(std::istream& input, std::string& line,
  450. State& state)
  451. {
  452. char bom[4];
  453. if (!input.get(bom, 4)) {
  454. this->LastResult.SetError(ResultErrorReadingInput, 1);
  455. return false;
  456. }
  457. this->LastResult.HadBOM =
  458. (bom[0] == char(0xEF) && bom[1] == char(0xBB) && bom[2] == char(0xBF));
  459. if (!state.ReadLine(input, line)) {
  460. this->LastResult.SetError(ResultErrorReadingInput, 1);
  461. return false;
  462. }
  463. if (!this->LastResult.HadBOM)
  464. line = bom + line; // it wasn't a BOM, prepend it to first line
  465. return true;
  466. }
  467. bool cmVisualStudioSlnParser::ParseMultiValueTag(const std::string& line,
  468. ParsedLine& parsedLine,
  469. State& state)
  470. {
  471. size_t idxEqualSign = line.find('=');
  472. const std::string& fullTag = line.substr(0, idxEqualSign);
  473. if (!this->ParseTag(fullTag, parsedLine, state))
  474. return false;
  475. if (idxEqualSign != line.npos) {
  476. size_t idxFieldStart = idxEqualSign + 1;
  477. if (idxFieldStart < line.size()) {
  478. size_t idxParsing = idxFieldStart;
  479. bool inQuotes = false;
  480. for (;;) {
  481. idxParsing = line.find_first_of(",\"", idxParsing);
  482. bool fieldOver = false;
  483. if (idxParsing == line.npos) {
  484. fieldOver = true;
  485. if (inQuotes) {
  486. this->LastResult.SetError(ResultErrorInputStructure,
  487. state.GetCurrentLine());
  488. return false;
  489. }
  490. } else if (line[idxParsing] == ',' && !inQuotes)
  491. fieldOver = true;
  492. else if (line[idxParsing] == '"')
  493. inQuotes = !inQuotes;
  494. if (fieldOver) {
  495. if (!this->ParseValue(
  496. line.substr(idxFieldStart, idxParsing - idxFieldStart),
  497. parsedLine))
  498. return false;
  499. if (idxParsing == line.npos)
  500. break; // end of last field
  501. idxFieldStart = idxParsing + 1;
  502. }
  503. ++idxParsing;
  504. }
  505. }
  506. }
  507. return true;
  508. }
  509. bool cmVisualStudioSlnParser::ParseSingleValueTag(const std::string& line,
  510. ParsedLine& parsedLine,
  511. State& state)
  512. {
  513. size_t idxEqualSign = line.find('=');
  514. const std::string& fullTag = line.substr(0, idxEqualSign);
  515. if (!this->ParseTag(fullTag, parsedLine, state))
  516. return false;
  517. if (idxEqualSign != line.npos) {
  518. if (!this->ParseValue(line.substr(idxEqualSign + 1), parsedLine))
  519. return false;
  520. }
  521. return true;
  522. }
  523. bool cmVisualStudioSlnParser::ParseKeyValuePair(const std::string& line,
  524. ParsedLine& parsedLine,
  525. State& /*state*/)
  526. {
  527. size_t idxEqualSign = line.find('=');
  528. if (idxEqualSign == line.npos) {
  529. parsedLine.CopyVerbatim(line);
  530. return true;
  531. }
  532. const std::string& key = line.substr(0, idxEqualSign);
  533. parsedLine.SetTag(cmSystemTools::TrimWhitespace(key));
  534. const std::string& value = line.substr(idxEqualSign + 1);
  535. parsedLine.AddValue(cmSystemTools::TrimWhitespace(value));
  536. return true;
  537. }
  538. bool cmVisualStudioSlnParser::ParseTag(const std::string& fullTag,
  539. ParsedLine& parsedLine, State& state)
  540. {
  541. size_t idxLeftParen = fullTag.find('(');
  542. if (idxLeftParen == fullTag.npos) {
  543. parsedLine.SetTag(cmSystemTools::TrimWhitespace(fullTag));
  544. return true;
  545. }
  546. parsedLine.SetTag(
  547. cmSystemTools::TrimWhitespace(fullTag.substr(0, idxLeftParen)));
  548. size_t idxRightParen = fullTag.rfind(')');
  549. if (idxRightParen == fullTag.npos) {
  550. this->LastResult.SetError(ResultErrorInputStructure,
  551. state.GetCurrentLine());
  552. return false;
  553. }
  554. const std::string& arg = cmSystemTools::TrimWhitespace(
  555. fullTag.substr(idxLeftParen + 1, idxRightParen - idxLeftParen - 1));
  556. if (arg[0] == '"') {
  557. if (arg[arg.size() - 1] != '"') {
  558. this->LastResult.SetError(ResultErrorInputStructure,
  559. state.GetCurrentLine());
  560. return false;
  561. }
  562. parsedLine.SetQuotedArg(arg.substr(1, arg.size() - 2));
  563. } else
  564. parsedLine.SetArg(arg);
  565. return true;
  566. }
  567. bool cmVisualStudioSlnParser::ParseValue(const std::string& value,
  568. ParsedLine& parsedLine)
  569. {
  570. const std::string& trimmed = cmSystemTools::TrimWhitespace(value);
  571. if (trimmed.empty())
  572. parsedLine.AddValue(trimmed);
  573. else if (trimmed[0] == '"' && trimmed[trimmed.size() - 1] == '"')
  574. parsedLine.AddQuotedValue(trimmed.substr(1, trimmed.size() - 2));
  575. else
  576. parsedLine.AddValue(trimmed);
  577. return true;
  578. }