Skip to content

Commit

Permalink
TEst.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Mar 12, 2020
1 parent 5d4d848 commit 042ea64
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion io/LasVLR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ std::istream& operator>>(std::istream& in, LasVLR& v)

// Make sure there isn't stuff in the input stream after the JSON
// object.
std::cerr << "Start of extraction loop!\n";
char c;
do
{
in >> c;
} while (std::isspace(c));
std::cerr << "End of extraction loop!\n";
if (!in.eof())
throw pdal_error("Invalid characters following LAS VLR JSON object.");

Expand Down Expand Up @@ -131,6 +133,7 @@ std::istream& operator>>(std::istream& in, LasVLR& v)
throw pdal_error("Invalid key '" + el.key() + "' in VLR "
"specificiation.");
}
std::cerr << "Looped items!\n";
if (b64data.empty())
throw pdal_error("LAS VLR must contain 'data' member.");
if (userId.empty())
Expand All @@ -142,6 +145,7 @@ std::istream& operator>>(std::istream& in, LasVLR& v)
v.m_recordId = recordId;
v.m_description = description;
v.m_data = Utils::base64_decode(b64data);
std::cerr << "Decoded Data size = " << v.m_data.size() << "!\n";
return in;
}

Expand All @@ -160,7 +164,10 @@ std::ostream& operator<<(std::ostream& out, const LasVLR& v)
out << " \"description\": \"" << v.description() << "\",\n";
out << " \"record_id\": " << v.recordId() << ",\n";
out << " \"user_id\": \"" << v.userId() << "\",\n";
out << " \"data\": \"" <<Utils::base64_encode(d, v.dataLen()) << "\"\n";
std::cerr << "VLR data len = " << v.dataLen() << "!\n";
std::cerr << "VLR encoded data len = " << Utils::base64_encode(d, v.dataLen()).size() << "!\n";
out << " \"data\": \"" << Utils::base64_encode(d, v.dataLen()) << "\"\n";
std::cerr << "Done writing encoded data!\n";
out << "}\n";
return out;
}
Expand Down

0 comments on commit 042ea64

Please sign in to comment.