Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
io.C
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1997 The CGAL Consortium
4 
5 // This software and related documentation is part of the Computational
6 // Geometry Algorithms Library (CGAL).
7 // This software and documentation is provided "as-is" and without warranty
8 // of any kind. In no event shall the CGAL Consortium be liable for any
9 // damage of any kind.
10 //
11 // Every use of CGAL requires a license.
12 //
13 // Academic research and teaching license
14 // - For academic research and teaching purposes, permission to use and copy
15 // the software and its documentation is hereby granted free of charge,
16 // provided that it is not a component of a commercial product, and this
17 // notice appears in all copies of the software and related documentation.
18 //
19 // Commercial licenses
20 // - A commercial license is available through Algorithmic Solutions, who also
21 // markets LEDA (http://www.algorithmic-solutions.de).
22 // - Commercial users may apply for an evaluation license by writing to
23 // Algorithmic Solutions (contact@algorithmic-solutions.com).
24 //
25 // The CGAL Consortium consists of Utrecht University (The Netherlands),
26 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
27 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
28 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
29 // and Tel-Aviv University (Israel).
30 //
31 // ----------------------------------------------------------------------
32 //
33 //
34 // release : CGAL-2.2
35 // release_date : 2000, September 30
36 //
37 // file : src/io.C
38 // package : iostream (2.8)
39 // source : $RCSfile: io.C,v $
40 // revision : $Revision: 1.1.1.1 $
41 // revision_date : $Date: 2001/07/05 22:17:49 $
42 // author(s) : Andreas Fabri
43 //
44 // coordinator : Mariette.Yvinec
45 //
46 // email : contact@cgal.org
47 // www : http://www.cgal.org
48 //
49 // ======================================================================
50 
51 
52 #ifndef CGAL_IO_C
53 #define CGAL_IO_C
54 
55 #include <CGAL/basic.h>
56 #include <CGAL/IO/io.h>
57 
59 
60 int IO::mode = std::ios::xalloc();
61 
62 
64 get_mode(std::ios& i)
65 {
66  return static_cast<IO::Mode>(i.iword(IO::mode));
67 }
68 
70 set_ascii_mode(std::ios& i)
71 {
72  IO::Mode m = get_mode(i);
73  i.iword(IO::mode) = IO::ASCII;
74  return m;
75 }
76 
77 
79 set_binary_mode(std::ios& i)
80 {
81  IO::Mode m = get_mode(i);
82  i.iword(IO::mode) = IO::BINARY;
83  return m;
84 }
85 
86 
88 set_pretty_mode(std::ios& i)
89 {
90  IO::Mode m = get_mode(i);
91  i.iword(IO::mode) = IO::PRETTY;
92  return m;
93 }
94 
95 
97 set_mode(std::ios& i, IO::Mode m)
98 {
99  IO::Mode old = get_mode(i);
100  i.iword(IO::mode) = m;
101  return old;
102 }
103 
104 bool
105 is_pretty(std::ios& i)
106 {
107  return i.iword(IO::mode) == IO::PRETTY;
108 }
109 
110 bool
111 is_ascii(std::ios& i)
112 {
113  return i.iword(IO::mode) == IO::ASCII;
114 }
115 
116 
117 bool
118 is_binary(std::ios& i)
119 {
120  return i.iword(IO::mode) == IO::BINARY;
121 }
122 
124 
125 #endif // CGAL_IO_C
IO::Mode get_mode(std::ios &i)
Definition: io.C:64
Definition: io.h:64
bool is_pretty(std::ios &i)
Definition: io.C:105
Definition: io.h:64
IO::Mode set_binary_mode(std::ios &i)
Definition: io.C:79
Mode
Definition: io.h:64
bool is_binary(std::ios &i)
Definition: io.C:118
blockLoc i
Definition: read.cpp:79
bool is_ascii(std::ios &i)
Definition: io.C:111
static int mode
Definition: io.h:63
Definition: io.h:64
IO::Mode set_mode(std::ios &i, IO::Mode m)
Definition: io.C:97
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
IO::Mode set_ascii_mode(std::ios &i)
Definition: io.C:70
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87
IO::Mode set_pretty_mode(std::ios &i)
Definition: io.C:88