-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTigObject.cxx
46 lines (40 loc) · 1.05 KB
/
TigObject.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// part of TigSortGUI
// author: Ulrike Hager
#include <iostream>
#include <sstream>
#include "TigObject.h"
TigObject::TigObject()
:mName("tigobject")
{
ObjType = "Object";
}
bool
TigObject::ParseInput(std::string line)
{
// std::cout << "[TigObject::ParseInput]" << std::endl;
std::string token;
std::istringstream stream(line.c_str());
stream >> token;
// std::cout << "[TigObject::ParseInput] " << mName << " token " << token << std::endl;
if ( token == "" || token[0] == '#') {
// std::cout << "[TigObject::ParseInput] " << mName << " comment: " << line << std::endl;
} //comment or blank
else if ( token.compare("name") == 0)
{
stream >> token;
this->ChangeName(token);
std::cout << " ..." << mName << "... ";
return true;
}
else if ( token.compare("description") == 0)
{
stream >> token;
this->ChangeDescription(token);
return true;
}
else {
// std::cout << "[TigObject::ParseInput] unknown token " << token << std::endl;
return false;
}
return true;
}