~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to src/plugins/dxf2shp_converter/dxflib/src/dl_writer_ascii.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
** $Id: dl_writer_ascii.h 2719 2005-09-24 20:41:23Z andrew $
 
3
**
 
4
** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
 
5
** Copyright (C) 2001 Robert J. Campbell Jr.
 
6
**
 
7
** This file is part of the dxflib project.
 
8
**
 
9
** This file may be distributed and/or modified under the terms of the
 
10
** GNU General Public License version 2 as published by the Free Software
 
11
** Foundation and appearing in the file LICENSE.GPL included in the
 
12
** packaging of this file.
 
13
**
 
14
** Licensees holding valid dxflib Professional Edition licenses may use
 
15
** this file in accordance with the dxflib Commercial License
 
16
** Agreement provided with the Software.
 
17
**
 
18
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
19
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
20
**
 
21
** See http://www.ribbonsoft.com for further details.
 
22
**
 
23
** Contact info@ribbonsoft.com if any conditions of this licensing are
 
24
** not clear to you.
 
25
**
 
26
**********************************************************************/
 
27
 
 
28
#ifndef DL_WRITER_ASCII_H
 
29
#define DL_WRITER_ASCII_H
 
30
 
 
31
#if _MSC_VER > 1000
 
32
#pragma once
 
33
#endif // _MSC_VER > 1000
 
34
 
 
35
#include "dl_writer.h"
 
36
#include <fstream>
 
37
#include <string>
 
38
using std::string;
 
39
 
 
40
/**
 
41
 * Implements functions defined in DL_Writer for writing low
 
42
 *   level DXF constructs to an ASCII format DXF file.
 
43
 *
 
44
 * @para fname File name of the file to be created.
 
45
 * @para version DXF version. Defaults to VER_2002.
 
46
 *
 
47
 * @todo What if \c fname is NULL?  Or \c fname can't be opened for
 
48
 * another reason?
 
49
 */
 
50
class DL_WriterA : public DL_Writer
 
51
{
 
52
  public:
 
53
    DL_WriterA( const char* fname, DL_Codes::version version = VER_2000 )
 
54
        : DL_Writer( version ), m_ofile( fname ) {}
 
55
    virtual ~DL_WriterA() {}
 
56
 
 
57
    bool openFailed() const;
 
58
    void close() const;
 
59
    void dxfReal( int gc, double value ) const;
 
60
    void dxfInt( int gc, int value ) const;
 
61
    void dxfHex( int gc, int value ) const;
 
62
    void dxfString( int gc, const char* value ) const;
 
63
    void dxfString( int gc, const string& value ) const;
 
64
 
 
65
    static void strReplace( char* str, char src, char dest );
 
66
 
 
67
  private:
 
68
    /**
 
69
     * DXF file to be created.
 
70
     */
 
71
    mutable std::ofstream m_ofile;
 
72
 
 
73
};
 
74
 
 
75
#endif
 
76