MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / load

Method load

Tools/MaterialEditor/MaterialEditor/src/DocManager.cpp:48–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void DocManager::load(wxString& path)
49{
50 // TODO: Clear tips list
51
52 std::ifstream fp;
53 fp.open(path, std::ios::in | std::ios::binary);
54 if(fp)
55 {
56 DataStreamPtr stream(new FileStreamDataStream(path.c_str(), &fp, false));
57
58 int index = -1;
59 String line;
60 String key;
61 while(!stream->eof())
62 {
63 line = stream->getLine();
64
65 // Ignore comments
66 if(line.length() > 0 && line.at(0) == '#') continue;
67
68 if(line.length() > 0 && line.at(0) == '[')
69 {
70 int endBrace = (int)line.find(']');
71 if(endBrace != -1)
72 {
73 key = line.substr(1, endBrace - 1);
74 }
75 }
76 else
77 {
78 if(mDocs.find(key) != mDocs.end())
79 mDocs[key] = mDocs[key] + "\n" + line;
80 else
81 mDocs[key] = line;
82 }
83 }
84 }
85}
86
87void DocManager::addDoc(wxString& key, wxString& doc)
88{

Callers 4

initializeMethod · 0.45
createOgrePaneMethod · 0.45
initializeMethod · 0.45
initializeMethod · 0.45

Calls 9

getLineMethod · 0.80
atMethod · 0.80
openMethod · 0.45
c_strMethod · 0.45
eofMethod · 0.45
lengthMethod · 0.45
findMethod · 0.45
substrMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected