summaryrefslogtreecommitdiff
blob: ce6f5e108a5ad69856a036d554fe31f042b8f8e6 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
From: Daniel Drake <dsd@gentoo.org>

Index: OpenMesh/Core/IO/OMFormat.hh
===================================================================
--- OpenMesh.orig/Core/IO/OMFormat.hh
+++ OpenMesh/Core/IO/OMFormat.hh
@@ -462,23 +462,6 @@ namespace OMFormat {
   typedef GenProg::False t_unsigned;
 
 
-  /// Store an integer with a wanted number of bits
-  template< typename T > 
-  inline
-  size_t 
-  store( std::ostream& _os, 
-	 const T& _val, 
-	 OMFormat::Chunk::Integer_Size _b, 
-	 bool _swap)
-  {    
-    assert( OMFormat::is_integer( _val ) );
-
-    if ( OMFormat::is_signed( _val ) )
-      return store( _os, _val, _b, _swap, t_signed()   );
-    return   store( _os, _val, _b, _swap, t_unsigned() );
-  }
-
-
   // helper to store a an integer
   template< typename T > 
   size_t 
@@ -497,24 +480,22 @@ namespace OMFormat {
 	 bool _swap,
 	 t_unsigned);
 
-
-  /// Restore an integer with a wanted number of bits
+  /// Store an integer with a wanted number of bits
   template< typename T > 
   inline
   size_t 
-  restore( std::istream& _is, 
-	   T& _val, 
-	   OMFormat::Chunk::Integer_Size _b, 
-	   bool _swap)
+  store( std::ostream& _os, 
+	 const T& _val, 
+	 OMFormat::Chunk::Integer_Size _b, 
+	 bool _swap)
   {    
     assert( OMFormat::is_integer( _val ) );
-    
+
     if ( OMFormat::is_signed( _val ) )
-      return restore( _is, _val, _b, _swap, t_signed() );
-    return restore( _is, _val, _b, _swap, t_unsigned() );    
+      return store( _os, _val, _b, _swap, t_signed()   );
+    return   store( _os, _val, _b, _swap, t_unsigned() );
   }
 
-
   // helper to store a an integer
   template< typename T > inline
   size_t restore( std::istream& _is, 
@@ -530,18 +511,26 @@ namespace OMFormat {
 		  OMFormat::Chunk::Integer_Size _b, 
 		  bool _swap,
 		  t_unsigned);
-  // 
-  // ---------------------------------------- storing vectors
 
-  /// storing a vector type
-  template <typename VecT> inline
-  size_t vector_store( std::ostream& _os, const VecT& _vec, bool _swap )
-  {
-    return store( _os, _vec, 
-		  GenProg::Int2Type< vector_traits<VecT>::size_ >(),
-		  _swap );
+  /// Restore an integer with a wanted number of bits
+  template< typename T > 
+  inline
+  size_t 
+  restore( std::istream& _is, 
+	   T& _val, 
+	   OMFormat::Chunk::Integer_Size _b, 
+	   bool _swap)
+  {    
+    assert( OMFormat::is_integer( _val ) );
+    
+    if ( OMFormat::is_signed( _val ) )
+      return restore( _is, _val, _b, _swap, t_signed() );
+    return restore( _is, _val, _b, _swap, t_unsigned() );    
   }
 
+  // 
+  // ---------------------------------------- storing vectors
+
   template <typename VecT> inline
   size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<1>, 
 		bool _swap )
@@ -579,19 +568,17 @@ namespace OMFormat {
     return bytes;
   }
 
-  // ---------------------------------------- restoring vectors
-
-  /// Restoring a vector type
-  template <typename VecT>
-  inline
-  size_t
-  vector_restore( std::istream& _is, VecT& _vec, bool _swap )
+  /// storing a vector type
+  template <typename VecT> inline
+  size_t vector_store( std::ostream& _os, const VecT& _vec, bool _swap )
   {
-    return restore( _is, _vec, 
-		    GenProg::Int2Type< vector_traits<VecT>::size_ >(),
-		    _swap );
+    return store( _os, _vec, 
+		  GenProg::Int2Type< vector_traits<VecT>::size_ >(),
+		  _swap );
   }
 
+  // ---------------------------------------- restoring vectors
+
 
   template <typename VecT>
   inline 
@@ -644,6 +631,17 @@ namespace OMFormat {
     return bytes;
   }
 
+  /// Restoring a vector type
+  template <typename VecT>
+  inline
+  size_t
+  vector_restore( std::istream& _is, VecT& _vec, bool _swap )
+  {
+    return restore( _is, _vec, 
+		    GenProg::Int2Type< vector_traits<VecT>::size_ >(),
+		    _swap );
+  }
+
   // ---------------------------------------- storing property names
   
   template <>