File: datafile.h

package info (click to toggle)
music 1.2.1-0.7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,596 kB
  • sloc: cpp: 26,805; sh: 5,674; python: 510; makefile: 406; ansic: 224
file content (38 lines) | stat: -rw-r--r-- 1,255 bytes parent folder | download | duplicates (6)
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
/* This file is part of the skol suite.
   Copyright (C) 2005, 2008, 2009 Mikael Djurfeldt

   The skol suite is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 3, or (at
   your option) any later version.

   The skol suite is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with the skol suite; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */


#ifndef DATAFILE_H

#include <string>
#include <fstream>

class Datafile : public std::ifstream {
 protected:
  bool atHeaderLine ();
  bool scanLine (const char* pattern);
 public:
  Datafile (std::string filename) : std::ifstream (filename.data ()) { }
  void ignoreLine ();
  void ignoreWhitespace ();
  bool read (const char*, int& x);
  bool read (const char*, double& x);
  void skipHeader ();
};
#define DATAFILE_H
#endif