unimplemented functions in range and path

This commit is contained in:
Crzyrndm 2018-07-02 11:09:41 +12:00
parent 650bfeb7dd
commit 1390d6a76e
2 changed files with 42 additions and 0 deletions

View File

@ -141,6 +141,22 @@ path::path(const std::string &path_string)
{
}
path::path(const std::string &path_string, char sep)
: internal_(path_string)
{
char curr_sep = guess_separator();
if (curr_sep != sep)
{
for (char& c : internal_) // simple find and replace
{
if (c == curr_sep)
{
c = sep;
}
}
}
}
// general attributes
bool path::is_relative() const

View File

@ -69,6 +69,11 @@ cell_vector range::operator[](std::size_t index)
return vector(index);
}
const cell_vector range::operator[](std::size_t index) const
{
return vector(index);
}
const worksheet &range::target_worksheet() const
{
return ws_;
@ -112,6 +117,22 @@ cell_vector range::vector(std::size_t vector_index)
return cell_vector(ws_, cursor, ref_, order_, skip_null_, false);
}
const cell_vector range::vector(std::size_t vector_index) const
{
auto cursor = ref_.top_left();
if (order_ == major_order::row)
{
cursor.row(cursor.row() + static_cast<row_t>(vector_index));
}
else
{
cursor.column_index(cursor.column_index() + static_cast<column_t::index_t>(vector_index));
}
return cell_vector(ws_, cursor, ref_, order_, skip_null_, false);
}
bool range::contains(const cell_reference &ref)
{
return ref_.top_left().column_index() <= ref.column_index()
@ -188,6 +209,11 @@ cell range::cell(const cell_reference &ref)
return (*this)[ref.row() - 1][ref.column().index - 1];
}
const cell range::cell(const cell_reference &ref) const
{
return (*this)[ref.row() - 1][ref.column().index - 1];
}
cell_vector range::front()
{
return *begin();