diff --git a/README.md b/README.md index dd83200..e35e1cc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Clara v1.1.4 +# Clara v1.1.5 [![Build Status](https://travis-ci.org/catchorg/Clara.svg?branch=master)](https://travis-ci.org/catchorg/Clara) [![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Clara?brach=master&svg=true)](https://ci.appveyor.com/project/catchorg/clara) [![codecov](https://codecov.io/gh/catchorg/Clara/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Clara) diff --git a/include/clara.hpp b/include/clara.hpp index fddfac6..b4dac54 100644 --- a/include/clara.hpp +++ b/include/clara.hpp @@ -5,7 +5,7 @@ // // See https://github.com/philsquared/Clara for more details -// Clara v1.1.4 +// Clara v1.1.5 #ifndef CLARA_HPP_INCLUDED #define CLARA_HPP_INCLUDED diff --git a/include/clara_textflow.hpp b/include/clara_textflow.hpp index 558845d..59783ad 100644 --- a/include/clara_textflow.hpp +++ b/include/clara_textflow.hpp @@ -16,7 +16,7 @@ #include #ifndef CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH -#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH +#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80 #endif @@ -39,7 +39,7 @@ namespace clara { namespace TextFlow { class Column { std::vector m_strings; - size_t m_width = TEXTFLOW_CONFIG_CONSOLE_WIDTH; + size_t m_width = CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH; size_t m_indent = 0; size_t m_initialIndent = std::string::npos; @@ -332,6 +332,6 @@ namespace clara { namespace TextFlow { cols += other; return cols; } -} +}} #endif // CLARA_TEXTFLOW_HPP_INCLUDED diff --git a/single_include/clara.hpp b/single_include/clara.hpp index 43568ce..6be5a98 100644 --- a/single_include/clara.hpp +++ b/single_include/clara.hpp @@ -5,7 +5,7 @@ // // See https://github.com/philsquared/Clara for more details -// Clara v1.1.4 +// Clara v1.1.5 #ifndef CLARA_HPP_INCLUDED #define CLARA_HPP_INCLUDED @@ -34,8 +34,8 @@ // // A single-header library for wrapping and laying out basic text, by Phil Nash // -// This work is licensed under the BSD 2-Clause license. -// See the accompanying LICENSE file, or the one at https://opensource.org/licenses/BSD-2-Clause +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // This project is hosted at https://github.com/philsquared/textflowcpp @@ -142,6 +142,12 @@ namespace clara { namespace TextFlow { } public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::forward_iterator_tag; + explicit iterator( Column const& column ) : m_column( column ) { assert( m_column.m_width > m_column.m_indent ); assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent ); @@ -153,10 +159,7 @@ namespace clara { namespace TextFlow { auto operator *() const -> std::string { assert( m_stringIndex < m_column.m_strings.size() ); assert( m_pos <= m_end ); - if( m_pos + m_column.m_width < m_end ) - return addIndentAndSuffix(line().substr(m_pos, m_len)); - else - return addIndentAndSuffix(line().substr(m_pos, m_end - m_pos)); + return addIndentAndSuffix(line().substr(m_pos, m_len)); } auto operator ++() -> iterator& { @@ -266,6 +269,12 @@ namespace clara { namespace TextFlow { } public: + using difference_type = std::ptrdiff_t; + using value_type = std::string; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::forward_iterator_tag; + explicit iterator( Columns const& columns ) : m_columns( columns.m_columns ), m_activeIterators( m_columns.size() ) @@ -355,7 +364,7 @@ namespace clara { namespace TextFlow { cols += other; return cols; } -}} // namespace clara::TextFlow +}} #endif // CLARA_TEXTFLOW_HPP_INCLUDED