Skip to content

Commit

Permalink
Fix a linker error and put some dots on some is
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-de-water committed Jan 5, 2020
1 parent 393434c commit d365f7d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ Lingo is an encoding aware string library for C++11 and up. It tries to be a dro
# Some of the features
* Encoding and code page aware `lingo::string` and `lingo::string_view`, almost fully compatible with `std::string` and `std::string_view`.
* Null terminator aware `lingo::string_view`.
* Support for endianness conversion.
* Automatic conversion between `lingo::string`s of different encodings and code pages.
* `lingo::encoding::*` for low level encoding and decoding of code points.
* `lingo::page::*` for additional code point information and conversion between different code pages.
* `lingo::error::*` for different error handling behaviours.
* Capable of handling endianness.
* `lingo::encoding::point_iterator` and `lingo::page::point_mapper` helpers to manually iterate or convert points individually.
* `lingo::string_converter` to manually convert entire strings.

# How it works
The string class from the standard library is defined like this:
Expand Down Expand Up @@ -81,7 +83,7 @@ It is indeed possible to use `lingo::encoding::none` instead, and still have a f
* `lingo::page::iso_8859_n` with n = [1, 16] except 12

## Error handlers
TODO for 0.1.0
* `lingo::error::strict` Throws an exception on error

## Algorithms
#### Will be added in a future version.
Expand Down
6 changes: 6 additions & 0 deletions src/lib/lingo/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ namespace lingo
};


template <typename Encoding, typename Page, typename Allocator>
LINGO_CONSTEXPR11 typename basic_string<Encoding, Page, Allocator>::size_type basic_string<Encoding, Page, Allocator>::npos;
template <typename Encoding, typename Page, typename Allocator>
LINGO_CONSTEXPR11 typename basic_string<Encoding, Page, Allocator>::unit_type basic_string<Encoding, Page, Allocator>::null_terminator;


template <typename Encoding, typename Page, typename LeftAllocator, typename RightAllocator>
bool operator == (basic_string<Encoding, Page, LeftAllocator> left, basic_string<Encoding, Page, RightAllocator> right)
{
Expand Down
16 changes: 16 additions & 0 deletions src/lib/lingo/string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,20 @@ namespace lingo
// Fixed encoding typedefs
template <typename Unit>
using basic_utf8_string_view = basic_unicode_string_view<encoding::utf8<Unit, char32_t>>;

template <typename Unit>
using basic_utf16_string_view = basic_unicode_string_view<encoding::utf16<Unit, char32_t>>;
template <typename Unit>
using basic_utf16_le_string_view = basic_unicode_string_view<encoding::utf16_le<Unit, char32_t>>;
template <typename Unit>
using basic_utf16_be_string_view = basic_unicode_string_view<encoding::utf16_be<Unit, char32_t>>;

template <typename Unit>
using basic_utf32_string_view = basic_unicode_string_view<encoding::utf32<Unit, char32_t>>;
template <typename Unit>
using basic_utf32_le_string_view = basic_unicode_string_view<encoding::utf32_le<Unit, char32_t>>;
template <typename Unit>
using basic_utf32_be_string_view = basic_unicode_string_view<encoding::utf32_be<Unit, char32_t>>;

// Fully specialized typedefs
using narrow_string_view = basic_string_view<encoding::cstring_default_encoding_t<char>, page::cstring_default_page_t<char>>;
Expand All @@ -341,8 +351,14 @@ namespace lingo
#else
using utf8_string_view = basic_utf8_string_view<char>;
#endif

using utf16_string_view = basic_utf16_string_view<char16_t>;
using utf16_le_string_view = basic_utf16_le_string_view<char16_t>;
using utf16_be_string_view = basic_utf16_be_string_view<char16_t>;

using utf32_string_view = basic_utf32_string_view<char32_t>;
using utf32_le_string_view = basic_utf32_le_string_view<char32_t>;
using utf32_be_string_view = basic_utf32_be_string_view<char32_t>;

// Default string_view typedef
using string_view = utf8_string_view;
Expand Down

0 comments on commit d365f7d

Please sign in to comment.