Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef MY_DXF_FILE_HPP
00044 #define MY_DXF_FILE_HPP 1
00045
00046
00047
00048
00049
00050
00051
00052 #include <fstream>
00053 #include "mydxfheader.hpp"
00054 #include "mydxftables.hpp"
00055 #include "mydxfblocks.hpp"
00056 #include "mydxfentities.hpp"
00057
00058
00059
00060
00068 class MyDXFFile
00069 {
00070 std::ifstream _istr;
00071 std::ofstream _ostr;
00072 bool _ascii;
00073 int _linec;
00074
00075 int _wlevel;
00076
00077 int _group_code;
00078 int _group_type;
00079
00080 std::string _group_string;
00081 double _group_double;
00082 bool _group_bool;
00083 int8_t _group_int8;
00084 int16_t _group_int16;
00085 int32_t _group_int32;
00086 int64_t _group_int64;
00087
00088 class MyDXFHeader *_header;
00089 class MyDXFTables *_tables;
00090 class MyDXFBlocks *_blocks;
00091 class MyDXFEntities *_entities;
00092
00093
00094 public:
00095
00098 MyDXFFile();
00099
00102 MyDXFFile( const std::string &filename );
00103
00106 ~MyDXFFile();
00107
00110 void read( const std::string &filename );
00111
00114 void write( const std::string &filename );
00115
00124 void set_warning_level( int wlevel ) { _wlevel = wlevel; }
00125
00128 int wlevel( void ) { return( _wlevel ); }
00129
00130
00131
00134 void write_group( int code, const char *data );
00135
00138 void write_group( int code, double data );
00139
00142 void write_group( int code, bool data );
00143
00146 void write_group( int code, int8_t data );
00147
00150 void write_group( int code, int16_t data );
00151
00154 void write_group( int code, int32_t data );
00155
00158 void write_group( int code, int64_t data );
00159
00160
00161
00167 int read_group( void );
00168
00171 int group_get_code( void ) const;
00172
00177 std::string group_get_string( void ) const;
00178
00183 double group_get_double( void ) const;
00184
00189 bool group_get_bool( void ) const;
00190
00195 int8_t group_get_int8( void ) const;
00196
00201 int16_t group_get_int16( void ) const;
00202
00207 int32_t group_get_int32( void ) const;
00208
00213 int64_t group_get_int64( void ) const;
00214
00217 int linec( void ) const { return( _linec ); }
00218
00219
00220
00221
00222
00225 class MyDXFEntities *get_entities( void ) { return( _entities ); };
00226
00229 const class MyDXFEntities *get_entities( void ) const { return( _entities ); };
00230
00231
00232
00235 class MyDXFBlocks *get_blocks( void ) { return( _blocks ); };
00236
00239 const class MyDXFBlocks *get_blocks( void ) const { return( _blocks ); };
00240
00241
00244 class MyDXFTables *get_tables( void ) { return( _tables ); };
00245
00248 const class MyDXFTables *get_tables( void ) const { return( _tables ); };
00249
00250
00251
00252
00255 void debug_print( std::ostream &os ) const;
00256 };
00257
00258
00259 #endif
00260
00261
00262
00263