Skip to content

Commit eea9a14

Browse files
dirkolbrichaothms
authored andcommitted
ifcparse: unify private member variables name to use trailing underscore
1 parent 8b14524 commit eea9a14

20 files changed

Lines changed: 327 additions & 326 deletions

src/ifcparse/IfcCharacterDecoder.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ using namespace IfcParse;
7272
using namespace IfcWrite;
7373

7474
IfcCharacterDecoder::IfcCharacterDecoder(IfcParse::IfcSpfStream* f) {
75-
file = f;
75+
stream_ = f;
7676
codepage_ = 0;
7777
}
7878

@@ -241,18 +241,18 @@ class pure_impure_helper {
241241
} // namespace
242242

243243
IfcCharacterDecoder::operator std::string() {
244-
return pure_impure_helper(file).get(mode, substitution_character);
244+
return pure_impure_helper(stream_).get(mode, substitution_character);
245245
}
246246

247247
std::string IfcCharacterDecoder::get(unsigned int& ptr) {
248-
return pure_impure_helper(file, ptr).get(mode, substitution_character);
248+
return pure_impure_helper(stream_, ptr).get(mode, substitution_character);
249249
}
250250

251251
void IfcCharacterDecoder::skip() {
252252
unsigned int parse_state = 0;
253253
char current_char;
254254
unsigned int hex_count = 0;
255-
while ((current_char = file->Peek()) != 0) {
255+
while ((current_char = stream_->Peek()) != 0) {
256256
if (EXPECTS_CHARACTER(parse_state)) {
257257
parse_state = 0;
258258
} else if (current_char == '\'' && (parse_state == 0U)) {
@@ -307,19 +307,19 @@ void IfcCharacterDecoder::skip() {
307307
if (parse_state == APOSTROPHE && current_char != '\'') {
308308
break;
309309
}
310-
throw IfcInvalidTokenException(file->Tell(), current_char);
310+
throw IfcInvalidTokenException(stream_->Tell(), current_char);
311311
} else {
312312
parse_state = hex_count = 0;
313313
}
314-
file->Inc();
314+
stream_->Inc();
315315
}
316316
}
317317

318318
IfcCharacterDecoder::ConversionMode IfcCharacterDecoder::mode = IfcCharacterDecoder::UTF8;
319319
char IfcCharacterDecoder::substitution_character = '_';
320320

321321
IfcCharacterEncoder::IfcCharacterEncoder(const std::string& input)
322-
: str(IfcUtil::convert_utf8_to_utf32(input)) {}
322+
: str_(IfcUtil::convert_utf8_to_utf32(input)) {}
323323

324324
IfcCharacterEncoder::operator std::string() {
325325
std::ostringstream oss;
@@ -328,12 +328,12 @@ IfcCharacterEncoder::operator std::string() {
328328
// Either 2 or 4 to uses \X2 or \X4 respectively.
329329
// Currently hardcoded to 4, but \X2 might be
330330
// sufficient for nearly all purposes.
331-
const int num_bytes = (str.empty() || (*std::max_element(str.begin(), str.end()) > 0xffff)) ? 4 : 2;
331+
const int num_bytes = (str_.empty() || (*std::max_element(str_.begin(), str_.end()) > 0xffff)) ? 4 : 2;
332332
const std::string num_bytes_str = std::string(1, num_bytes + 0x30);
333333

334334
bool in_extended = false;
335335

336-
for (auto it = str.begin(); it != str.end(); ++it) {
336+
for (auto it = str_.begin(); it != str_.end(); ++it) {
337337
auto ch = *it;
338338
const bool within_spf_range = ch >= 0x20 && ch <= 0x7e;
339339
if (in_extended && within_spf_range) {

src/ifcparse/IfcCharacterDecoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace IfcParse {
4242

4343
class IFC_PARSE_API IfcCharacterDecoder {
4444
private:
45-
IfcParse::IfcSpfStream* file;
45+
IfcParse::IfcSpfStream* stream_;
4646
int codepage_;
4747

4848
public:
@@ -72,7 +72,7 @@ namespace IfcWrite {
7272

7373
class IFC_PARSE_API IfcCharacterEncoder {
7474
private:
75-
std::u32string str;
75+
std::u32string str_;
7676

7777
public:
7878
IfcCharacterEncoder(const std::string& input);

src/ifcparse/IfcException.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
namespace IfcParse {
3737
class IFC_PARSE_API IfcException : public std::exception {
3838
private:
39-
std::string message;
39+
std::string message_;
4040

4141
public:
4242
IfcException(const std::string& m)
43-
: message(m) {}
43+
: message_(m) {}
4444
virtual ~IfcException() throw() {}
4545
virtual const char* what() const throw() {
46-
return message.c_str();
46+
return message_.c_str();
4747
}
4848
};
4949

src/ifcparse/IfcFile.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ class IFC_PARSE_API IfcFile {
135135

136136
std::vector<Argument*> internal_attribute_vector_, internal_attribute_vector_simple_type_;
137137

138-
entity_by_id_t byid;
138+
entity_by_id_t byid_;
139139
// this is for simple types
140-
entity_by_iden_t byidentity;
141-
entities_by_type_t bytype;
142-
entities_by_type_t bytype_excl;
143-
entities_by_ref_t byref;
144-
entities_by_ref_excl_t byref_excl;
145-
entity_by_guid_t byguid;
146-
entity_entity_map_t entity_file_map;
140+
entity_by_iden_t byidentity_;
141+
entities_by_type_t bytype_;
142+
entities_by_type_t bytype_excl_;
143+
entities_by_ref_t byref_;
144+
entities_by_ref_excl_t byref_excl_;
145+
entity_by_guid_t byguid_;
146+
entity_entity_map_t entity_file_map_;
147147

148148
unsigned int MaxId;
149149

@@ -316,7 +316,7 @@ class IFC_PARSE_API IfcFile {
316316

317317
void build_inverses();
318318

319-
entity_by_guid_t& internal_guid_map() { return byguid; };
319+
entity_by_guid_t& internal_guid_map() { return byguid_; };
320320
};
321321

322322
#ifdef WITH_IFCXML

src/ifcparse/IfcGlobalId.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ void expand(const std::string& s, std::vector<unsigned char>& v) {
8989
static boost::uuids::basic_random_generator<boost::mt19937> gen;
9090

9191
IfcParse::IfcGlobalId::IfcGlobalId() {
92-
uuid_data = gen();
93-
std::vector<unsigned char> v(uuid_data.size());
94-
std::copy(uuid_data.begin(), uuid_data.end(), v.begin());
95-
string_data = compress(&v[0]);
92+
uuid_data_ = gen();
93+
std::vector<unsigned char> v(uuid_data_.size());
94+
std::copy(uuid_data_.begin(), uuid_data_.end(), v.begin());
95+
string_data_ = compress(&v[0]);
9696
#if BOOST_VERSION < 104400
9797
formatted_string = boost::lexical_cast<std::string>(uuid_data);
9898
#else
99-
formatted_string = boost::uuids::to_string(uuid_data);
99+
formatted_string_ = boost::uuids::to_string(uuid_data_);
100100
#endif
101101

102102
#ifndef NDEBUG
@@ -111,14 +111,14 @@ IfcParse::IfcGlobalId::IfcGlobalId() {
111111
}
112112

113113
IfcParse::IfcGlobalId::IfcGlobalId(const std::string& s)
114-
: string_data(s) {
114+
: string_data_(s) {
115115
std::vector<unsigned char> v;
116-
expand(string_data, v);
117-
std::copy(v.begin(), v.end(), uuid_data.begin());
116+
expand(string_data_, v);
117+
std::copy(v.begin(), v.end(), uuid_data_.begin());
118118
#if BOOST_VERSION < 104400
119119
formatted_string = boost::lexical_cast<std::string>(uuid_data);
120120
#else
121-
formatted_string = boost::uuids::to_string(uuid_data);
121+
formatted_string_ = boost::uuids::to_string(uuid_data_);
122122
#endif
123123

124124
#ifndef NDEBUG
@@ -130,13 +130,13 @@ IfcParse::IfcGlobalId::IfcGlobalId(const std::string& s)
130130
}
131131

132132
IfcParse::IfcGlobalId::operator const std::string&() const {
133-
return string_data;
133+
return string_data_;
134134
}
135135

136136
IfcParse::IfcGlobalId::operator const boost::uuids::uuid&() const {
137-
return uuid_data;
137+
return uuid_data_;
138138
}
139139

140140
const std::string& IfcParse::IfcGlobalId::formatted() const {
141-
return formatted_string;
141+
return formatted_string_;
142142
}

src/ifcparse/IfcGlobalId.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ namespace IfcParse {
3030
/// A helper class for the creation of IFC GlobalIds.
3131
class IFC_PARSE_API IfcGlobalId {
3232
private:
33-
std::string string_data, formatted_string;
34-
boost::uuids::uuid uuid_data;
33+
std::string string_data_;
34+
std::string formatted_string_;
35+
boost::uuids::uuid uuid_data_;
3536

3637
public:
3738
static const unsigned int length = 22;

src/ifcparse/IfcHierarchyHelper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,8 @@ void push_back_to_maybe_optional(boost::optional<boost::shared_ptr<T>>& t, U* u)
995995

996996
template <typename Schema>
997997
typename Schema::IfcGeometricRepresentationContext* IfcHierarchyHelper<Schema>::getRepresentationContext(const std::string& s) {
998-
typename std::map<std::string, typename Schema::IfcGeometricRepresentationContext*>::const_iterator it = contexts.find(s);
999-
if (it != contexts.end()) {
998+
typename std::map<std::string, typename Schema::IfcGeometricRepresentationContext*>::const_iterator it = contexts_.find(s);
999+
if (it != contexts_.end()) {
10001000
return it->second;
10011001
}
10021002
typename Schema::IfcProject* project = getSingle<typename Schema::IfcProject>();
@@ -1010,7 +1010,7 @@ typename Schema::IfcGeometricRepresentationContext* IfcHierarchyHelper<Schema>::
10101010
push_back_to_maybe_optional(project_contexts, context);
10111011

10121012
project->setRepresentationContexts(project_contexts);
1013-
return contexts[s] = context;
1013+
return contexts_[s] = context;
10141014
}
10151015

10161016
#ifdef HAS_SCHEMA_2x3

src/ifcparse/IfcHierarchyHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile {
517517
typename Schema::IfcGeometricRepresentationContext* getRepresentationContext(const std::string&);
518518

519519
private:
520-
std::map<std::string, typename Schema::IfcGeometricRepresentationContext*> contexts;
520+
std::map<std::string, typename Schema::IfcGeometricRepresentationContext*> contexts_;
521521
};
522522

523523
#ifdef HAS_SCHEMA_2x3

0 commit comments

Comments
 (0)