Points&Forces (core)
Software tools facilitating the task of surveying architecture
a_dxf_group.h
Go to the documentation of this file.
1 /*
2 Copyright 2010 Pierre SMARS (smars@yuntech.edu.tw)
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 2 of the License, or
6 (at your option) any later version.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #ifndef _VE_DXF_GROUP_H_
17 #define _VE_DXF_GROUP_H_
18 
19 #include <iostream>
20 #include <string>
21 
30 {
31 public:
32  a_dxf_group(std::istream * file) : code_(0), data_() {file_ = file;}
33  bool read();
34  void write();
35  void putback();
36  int code() {return code_;}
37  std::string data() {return data_;}
38  int data_int();
39  double data_double();
40  bool data_is(std::string s) {return s == data_;}
41 
43  class file_error {};
44 
45 protected:
46  std::istream * file_;
47  int code_;
48  std::string data_;
49  static std::string eof_;
50 };
51 
52 #endif
a dxf group
Definition: a_dxf_group.h:30
double data_double()
Definition: a_dxf_group.cxx:90
int code()
Definition: a_dxf_group.h:36
a_dxf_group(std::istream *file)
Definition: a_dxf_group.h:32
bool data_is(std::string s)
Definition: a_dxf_group.h:40
int data_int()
Definition: a_dxf_group.cxx:81
static std::string eof_
Definition: a_dxf_group.h:49
void write()
Definition: a_dxf_group.cxx:62
void putback()
Definition: a_dxf_group.cxx:68
std::istream * file_
Definition: a_dxf_group.h:46
std::string data_
Definition: a_dxf_group.h:48
std::string data()
Definition: a_dxf_group.h:37