Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit a6dfbbd

Browse files
committed
v1.1.5
1 parent f0e8fa3 commit a6dfbbd

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Clara v1.1.4
1+
# Clara v1.1.5
22
[![Build Status](https://travis-ci.org/catchorg/Clara.svg?branch=master)](https://travis-ci.org/catchorg/Clara)
33
[![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Clara?brach=master&svg=true)](https://ci.appveyor.com/project/catchorg/clara)
44
[![codecov](https://codecov.io/gh/catchorg/Clara/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Clara)

include/clara.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// See https://github.com/philsquared/Clara for more details
77

8-
// Clara v1.1.4
8+
// Clara v1.1.5
99

1010
#ifndef CLARA_HPP_INCLUDED
1111
#define CLARA_HPP_INCLUDED

include/clara_textflow.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <vector>
1717

1818
#ifndef CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
19-
#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
19+
#define CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80
2020
#endif
2121

2222

@@ -39,7 +39,7 @@ namespace clara { namespace TextFlow {
3939

4040
class Column {
4141
std::vector<std::string> m_strings;
42-
size_t m_width = TEXTFLOW_CONFIG_CONSOLE_WIDTH;
42+
size_t m_width = CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH;
4343
size_t m_indent = 0;
4444
size_t m_initialIndent = std::string::npos;
4545

@@ -332,6 +332,6 @@ namespace clara { namespace TextFlow {
332332
cols += other;
333333
return cols;
334334
}
335-
}
335+
}}
336336

337337
#endif // CLARA_TEXTFLOW_HPP_INCLUDED

single_include/clara.hpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// See https://github.com/philsquared/Clara for more details
77

8-
// Clara v1.1.4
8+
// Clara v1.1.5
99

1010
#ifndef CLARA_HPP_INCLUDED
1111
#define CLARA_HPP_INCLUDED
@@ -34,8 +34,8 @@
3434
//
3535
// A single-header library for wrapping and laying out basic text, by Phil Nash
3636
//
37-
// This work is licensed under the BSD 2-Clause license.
38-
// See the accompanying LICENSE file, or the one at https://opensource.org/licenses/BSD-2-Clause
37+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
38+
// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
3939
//
4040
// This project is hosted at https://github.com/philsquared/textflowcpp
4141

@@ -142,6 +142,12 @@ namespace clara { namespace TextFlow {
142142
}
143143

144144
public:
145+
using difference_type = std::ptrdiff_t;
146+
using value_type = std::string;
147+
using pointer = value_type*;
148+
using reference = value_type&;
149+
using iterator_category = std::forward_iterator_tag;
150+
145151
explicit iterator( Column const& column ) : m_column( column ) {
146152
assert( m_column.m_width > m_column.m_indent );
147153
assert( m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent );
@@ -153,10 +159,7 @@ namespace clara { namespace TextFlow {
153159
auto operator *() const -> std::string {
154160
assert( m_stringIndex < m_column.m_strings.size() );
155161
assert( m_pos <= m_end );
156-
if( m_pos + m_column.m_width < m_end )
157-
return addIndentAndSuffix(line().substr(m_pos, m_len));
158-
else
159-
return addIndentAndSuffix(line().substr(m_pos, m_end - m_pos));
162+
return addIndentAndSuffix(line().substr(m_pos, m_len));
160163
}
161164

162165
auto operator ++() -> iterator& {
@@ -266,6 +269,12 @@ namespace clara { namespace TextFlow {
266269
}
267270

268271
public:
272+
using difference_type = std::ptrdiff_t;
273+
using value_type = std::string;
274+
using pointer = value_type*;
275+
using reference = value_type&;
276+
using iterator_category = std::forward_iterator_tag;
277+
269278
explicit iterator( Columns const& columns )
270279
: m_columns( columns.m_columns ),
271280
m_activeIterators( m_columns.size() )
@@ -355,7 +364,7 @@ namespace clara { namespace TextFlow {
355364
cols += other;
356365
return cols;
357366
}
358-
}} // namespace clara::TextFlow
367+
}}
359368

360369
#endif // CLARA_TEXTFLOW_HPP_INCLUDED
361370

0 commit comments

Comments
 (0)