save << (int)myToUseBoundaryRecoveryVersion << " ";
save << (int)myToUseFemCorrection << " ";
save << (int)myToRemoveCentralPoint << " ";
- save << "__OPTIONS_BEGIN__ ";
- save << myTextOption << " ";
- save << " __OPTIONS_END__ ";
+ if (!myTextOption.empty()) {
+ save << "__OPTIONS_BEGIN__ ";
+ save << myTextOption << " ";
+ save << "__OPTIONS_END__ ";
+ }
TEnforcedVertexValues::iterator it = myEnforcedVertices.begin();
else
load.clear(ios::badbit | load.rdstate());
-// isOK = (load >> myTextOption);
-// while (isOK) {
-// std::string txt;
-// if (load >> txt) {
-// myTextOption += " ";
-// myTextOption += txt;
-// }
-// else
-// isOK = false;
-// }
-// // else
-// // load.clear(ios::badbit | load.rdstate());
-
-
std::string separator;
bool hasOptions = false;
bool hasEnforcedVertices = false;
hasOptions = true;
else if (separator == "__ENFORCED_VERTICES_BEGIN__")
hasEnforcedVertices = true;
-
+
if (hasOptions) {
std::string txt;
- isOK = (load >> myTextOption);
while (isOK) {
- if (myTextOption == "__OPTIONS_END__") {
- isOK = false;
- break;
- }
- if (load >> txt) {
+ isOK = (load >> txt);
+ if (isOK) {
if (txt == "__OPTIONS_END__") {
+ if (!myTextOption.empty()) {
+ // Remove last space
+ myTextOption.erase(myTextOption.end()-1);
+ }
isOK = false;
break;
}
- myTextOption += " ";
myTextOption += txt;
+ myTextOption += " ";
}
- else
- isOK = false;
}
}