return ProcessResult;
+}
+
+map<string, string> SplitValues(string InputData){
+
+ map<string,string> FinalSplitValues;
+ map<int,int> SplitPoints;
+ map<int,int> SplitLength;
+ size_t intPropertyLen = InputData.size();
+ int intSplitsFound = 0;
+ int intSplitSize = 0;
+ int intSplitSeek = 0;
+ int intPrevSplitFound = 0;
+
+ // Get the split points.
+
+ for (int i = 0; i <= intPropertyLen; i++){
+
+ intSplitSize++;
+
+ InputData.substr(intPrevSplitFound, intSplitSize);
+
+ if (InputData.substr(i, 1) == ";" &&
+ InputData.substr((i - 1), 1) != "\\"){
+
+ if (intSplitsFound > 0){
+
+ // Split the value into two.
+
+ PropertyNameValue NVData = SplitNameValue(InputData.substr(intPrevSplitFound, (intSplitSize - 1)));
+
+ if (FinalSplitValues.find(NVData.Name) != FinalSplitValues.end()){
+ FinalSplitValues.insert(make_pair(NVData.Name, NVData.Value));
+ } else {
+ FinalSplitValues[NVData.Name] = NVData.Value;
+ }
+
+ }
+
+ intPrevSplitFound = i + 1;
+ intSplitSize = 0;
+ intSplitsFound++;
+
+ }
+
+ }
+
+ if (intSplitsFound > 0){
+
+ PropertyNameValue NVData = SplitNameValue(InputData.substr(intPrevSplitFound, (intSplitSize - 1)));
+
+ if (FinalSplitValues.find(NVData.Name) != FinalSplitValues.end()){
+ FinalSplitValues.insert(make_pair(NVData.Name, NVData.Value));
+ } else {
+ FinalSplitValues[NVData.Name] = NVData.Value;
+ }
+
+ }
+
+ return FinalSplitValues;
+
+}
+
+PropertyNameValue SplitNameValue(string InputData){
+
+ PropertyNameValue FinalNameValue;
+ int InputDataLength = InputData.size();
+ int SeekCount = 0;
+ bool QuoteMode = false;
+ bool DataFound = false;
+
+ while (SeekCount < InputDataLength){
+
+ if (InputData[SeekCount] == '='){
+
+ FinalNameValue.Name = InputData.substr(0, SeekCount);
+
+ try{
+ FinalNameValue.Value = InputData.substr((SeekCount + 1));
+ }
+
+ catch (const out_of_range &oor){
+ // Do nothing. Have an empty final value.
+ }
+
+ DataFound = true;
+ break;
+ }
+
+ SeekCount++;
+
+ }
+
+ if (DataFound == false){
+
+ FinalNameValue.Name = InputData;
+
+ }
+
+ return FinalNameValue;
+
}
\ No newline at end of file
#include <map>
#include <iostream>
+#ifndef __COMMON_TEXT_H__
+#define __COMMON_TEXT_H__
+
+struct PropertyNameValue{
+ std::string Name;
+ std::string Value;
+};
+
std::multimap<std::string, std::string> ProcessTextVectors(std::vector<std::string> *TextProperties,
std::vector<std::string> *TextValues,
bool SearchMultiple,
- std::string Property);
\ No newline at end of file
+ std::string Property);
+std::map<std::string, std::string> SplitValues(std::string InputData);
+PropertyNameValue SplitNameValue(std::string InputData);
+
+#endif
\ No newline at end of file