Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kzampog committed Jan 26, 2020
1 parent 3aaca88 commit 73c9cdb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/cilantro/utilities/ply_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ namespace cilantro {
char * p_end {nullptr};
size_t size;

MemoryBuffer(char const * first_elem, size_t size)
inline MemoryBuffer(char const * first_elem, size_t size)
: p_start(const_cast<char*>(first_elem)), p_end(p_start + size), size(size)
{
setg(p_start, p_start, p_end);
}

pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which) override {
inline pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which) override {
if (dir == std::ios_base::cur) gbump(static_cast<int>(off));
else setg(p_start, (dir == std::ios_base::beg ? p_start : p_end) + off, p_end);
return gptr() - p_start;
}

pos_type seekpos(pos_type pos, std::ios_base::openmode which) override {
inline pos_type seekpos(pos_type pos, std::ios_base::openmode which) override {
return seekoff(pos, std::ios_base::beg, which);
}
};

// From tinyply example-utils.hpp
struct MemoryStream : virtual MemoryBuffer, public std::istream {
MemoryStream(char const * first_elem, size_t size)
inline MemoryStream(char const * first_elem, size_t size)
: MemoryBuffer(first_elem, size), std::istream(static_cast<std::streambuf*>(this))
{}
};
Expand All @@ -52,7 +52,7 @@ namespace cilantro {
}

inline bool elementPropertyExists(const std::string &element_key,
const std::vector<std::string> property_keys) const
const std::vector<std::string> &property_keys) const
{
const auto elements = ply_file_.get_elements();
ptrdiff_t element_ind = -1;
Expand All @@ -76,7 +76,7 @@ namespace cilantro {
}

inline std::shared_ptr<tinyply::PlyData> requestData(const std::string &element_key,
const std::vector<std::string> property_keys,
const std::vector<std::string> &property_keys,
const uint32_t list_size_hint = 0)
{
if (!elementPropertyExists(element_key, property_keys)) return std::shared_ptr<tinyply::PlyData>();
Expand Down Expand Up @@ -110,7 +110,7 @@ namespace cilantro {
{}

inline PLYWriter& addData(const std::string &element_key,
const std::vector<std::string> property_keys,
const std::vector<std::string> &property_keys,
const std::shared_ptr<tinyply::PlyData> &data_buffer,
const tinyply::Type list_type = tinyply::Type::INVALID,
const size_t list_count = 0)
Expand Down

0 comments on commit 73c9cdb

Please sign in to comment.