MCPcopy Create free account
hub / github.com/Singular/Singular / open

Method open

gfanlib/gfanlib_polymakefile.cpp:74–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73
74void PolymakeFile::open(std::istream &f)
75{
76 isXml=false;
77// fileName=string(fileName_);
78
79// FILE *f=fopen(fileName.c_str(),"r");
80// if(!f)//fprintf(Stderr,"Could not open file:\"%s\"\n",fileName_);
81// assert(f);
82
83 int c=f.get();//fgetc(f);
84 while(!f.eof())
85 {
86 if(c=='_')
87 {
88 readUntil(f,'\n');
89 }
90 else if(c!='\n')
91 {
92 f.unget();
93 // ungetc(c,f);
94 string name=readUntil(f,'\n');
95
96// fprintf(Stderr,"Reading:\"%s\"\n",name.c_str());
97 stringstream value;
98 while(1)
99 {
100 string l=readUntil(f,'\n');
101 if(l.size()==0)break;
102 value << l <<endl;
103 }
104 properties.push_back(PolymakeProperty(name.c_str(),value.str().c_str()));
105 }
106 c=f.get();//fgetc(f);
107 }
108}
109
110/*void PolymakeFile::open(const char *fileName_)
111{

Callers 5

printTableFunction · 0.80
readFanMethod · 0.80
ZFanMethod · 0.80
RedirectMethod · 0.80
fetch_tbz2_dataFunction · 0.80

Calls 7

readUntilFunction · 0.85
PolymakePropertyClass · 0.85
c_strMethod · 0.80
getMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
strMethod · 0.45

Tested by 1

RedirectMethod · 0.64