Skip to content

Commit 18ab3b1

Browse files
author
Steve Hanson
committed
remove temp debug statements
1 parent 6d253c1 commit 18ab3b1

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

include/rapidjson/uri.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ RAPIDJSON_NAMESPACE_BEGIN
3939

4040
//! Constructors
4141
GenericUri(Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
42-
//std::cout << "Default constructor" << std::endl;
4342
}
4443

4544
GenericUri(const Ch* uri, SizeType len, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
@@ -64,26 +63,22 @@ RAPIDJSON_NAMESPACE_BEGIN
6463

6564
//! Copy constructor
6665
GenericUri(const GenericUri& rhs) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(rhs.allocator_), ownAllocator_() {
67-
//std::cout << "Copy constructor" << std::endl;
6866
*this = rhs;
6967
}
7068

7169
//! Copy constructor
7270
GenericUri(const GenericUri& rhs, Allocator* allocator) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
73-
//std::cout << "Copy constructor" << std::endl;
7471
*this = rhs;
7572
}
7673

7774
//! Destructor.
7875
~GenericUri() {
79-
//std::cout << "Destructor" << std::endl;
8076
Free();
8177
RAPIDJSON_DELETE(ownAllocator_);
8278
}
8379

8480
//! Assignment operator
8581
GenericUri& operator=(const GenericUri& rhs) {
86-
//std::cout << "Operator=" << std::endl;
8782
if (this != &rhs) {
8883
// Do not delete ownAllocator
8984
Free();
@@ -95,7 +90,6 @@ RAPIDJSON_NAMESPACE_BEGIN
9590
base_ = CopyPart(frag_, rhs.frag_, rhs.GetFragStringLength());
9691
uri_ = CopyPart(base_, rhs.base_, rhs.GetBaseStringLength());
9792
CopyPart(uri_, rhs.uri_, rhs.GetStringLength());
98-
//std::wcout << L" Assignment uri: " << uri_ << ", length: " << GetStringLength() << std::endl;
9993
}
10094
return *this;
10195
}
@@ -160,7 +154,6 @@ RAPIDJSON_NAMESPACE_BEGIN
160154
// Use for resolving an id or $ref with an in-scope id.
161155
// Returns a new GenericUri for the resolved URI.
162156
GenericUri Resolve(const GenericUri& baseuri, Allocator* allocator = 0) {
163-
//std::cout << "Resolve" << std::endl;
164157
GenericUri resuri;
165158
resuri.allocator_ = allocator;
166159
// Ensure enough space for combining paths
@@ -224,13 +217,11 @@ RAPIDJSON_NAMESPACE_BEGIN
224217
}
225218
// Always use this frag
226219
resuri.base_ = CopyPart(resuri.frag_, frag_, GetFragStringLength());
227-
//std::wcout << L" Resolved uri: " << L"s: " << resuri.scheme_ << L" a: " << resuri.auth_ << L" p: " << resuri.path_ << L" q: " << resuri.query_ << L" f: " << resuri.frag_ << std::endl;
228220

229221
// Re-constitute base_ and uri_
230222
resuri.SetBase();
231223
resuri.uri_ = resuri.base_ + resuri.GetBaseStringLength() + 1;
232224
resuri.SetUri();
233-
//std::wcout << L" Resolved rebuilt uri: " << resuri.uri_ << L", length: " << resuri.GetStringLength() << std::endl;
234225
return resuri;
235226
}
236227

@@ -241,7 +232,6 @@ RAPIDJSON_NAMESPACE_BEGIN
241232
// Allocate memory for a URI
242233
// Returns total amount allocated
243234
std::size_t Allocate(std::size_t len) {
244-
//std::cout << "Allocate" << std::endl;
245235
// Create own allocator if user did not supply.
246236
if (!allocator_)
247237
ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
@@ -263,15 +253,12 @@ RAPIDJSON_NAMESPACE_BEGIN
263253
*base_ = '\0';
264254
uri_ = base_ + 1;
265255
*uri_ = '\0';
266-
//std::cout << " Allocating " << total << std::endl;
267256
return total;
268257
}
269258

270259
// Free memory for a URI
271260
void Free() {
272-
//std::cout << "Free" << std::endl;
273261
if (scheme_) {
274-
//std::cout << " Freeing" << std::endl;
275262
Allocator::Free(scheme_);
276263
scheme_ = 0;
277264
}
@@ -281,7 +268,6 @@ RAPIDJSON_NAMESPACE_BEGIN
281268
// Supports URIs that match regex ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? as per
282269
// https://tools.ietf.org/html/rfc3986
283270
void Parse(const Ch* uri, std::size_t len) {
284-
//std::cout << "Parse" << std::endl;
285271
std::size_t start = 0, pos1 = 0, pos2 = 0;
286272
Allocate(len);
287273

@@ -368,14 +354,12 @@ RAPIDJSON_NAMESPACE_BEGIN
368354
std::memcpy(frag_, &uri[start], (len - start) * sizeof(Ch));
369355
frag_[len - start] = '\0';
370356
}
371-
//std::wcout << L" Parsed uri: " << L"s: " << scheme_ << L" a: " << auth_ << L" p: " << path_ << L" q: " << query_ << L" f: " << frag_ << std::endl;
372357

373358
// Re-constitute base_ and uri_
374359
base_ = frag_ + GetFragStringLength() + 1;
375360
SetBase();
376361
uri_ = base_ + GetBaseStringLength() + 1;
377362
SetUri();
378-
//std::wcout << L" Rebuilt uri: " << uri_ << L", length: " << GetStringLength() << std::endl;
379363
}
380364

381365
// Reconstitute base
@@ -433,7 +417,6 @@ RAPIDJSON_NAMESPACE_BEGIN
433417
if (slashpos == 2 && path_[pathpos] == '.' && path_[pathpos + 1] == '.') {
434418
// Backup a .. segment in the new path_
435419
// We expect to find a previously added slash at the end or nothing
436-
//std::wcout << L" Path - backing up .. in " << path_ << std::endl;
437420
size_t lastslashpos = newpos;
438421
while (lastslashpos > 0) {
439422
if (path_[lastslashpos - 1] == '/') break;
@@ -452,7 +435,6 @@ RAPIDJSON_NAMESPACE_BEGIN
452435
}
453436
} else if (slashpos == 1 && path_[pathpos] == '.') {
454437
// Discard . segment, leaves new path_ unchanged
455-
//std::wcout << L" Path - removing . in " << path_ << std::endl;
456438
} else {
457439
// Move any other kind of segment to the new path_
458440
RAPIDJSON_ASSERT(newpos <= pathpos);
@@ -468,7 +450,6 @@ RAPIDJSON_NAMESPACE_BEGIN
468450
pathpos += slashpos + 1;
469451
}
470452
path_[newpos] = '\0';
471-
//std::wcout << L" Normalized Path: " << path_ << ", length: " << GetPathStringLength() << std::endl;
472453
}
473454

474455
Ch* uri_; // Everything

0 commit comments

Comments
 (0)