void KVFile::readConfig(const string& filename) {
    ifstream fin(filename.c_str());
    string line;
    char buffer[BUFFLEN];
    uint32_t state;
    while (!fin.eof()) {
      fin.getline(buffer, BUFFLEN);
      state = fin.rdstate();
      if (state & ios::eofbit)
	break;
      if (state != 0) {
	fin.close();
	throw KVFileException(state);
      }
      line = buffer;
      trim(line);
      // ignore blank lines...
      if (line.length() == 0)
	continue;
      // ...and comments
      if (line[0] == '#')
	continue;
      //cout << line << endl;;
      storeLine(line);
    }
    fin.close();
  }
Example #2
0
void convertData(int fi, int fo) {
	char buf[512];
	int ret;
	int i;
	int glyphIndex;
	int glyphHeight;

	ret = 1;
	while (ret > 0) {
		ret = readLine(fi, buf);
		if (ret < 0) {
			break;
		}
		if (buf[0] == '#') {
		    switch(buf[1]) {
		    	case '#':
			    storeLine(fo, buf + 2);
			    break;
		    }
		    
		}
	}
}