Skip to content

Commit

Permalink
Update UniLib to 3.3.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
foxik committed Sep 12, 2023
1 parent f813be0 commit 12660ae
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 18 deletions.
5 changes: 5 additions & 0 deletions src/unilib/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 3.3.1 [12 Sep 2023]
---------------------------
- Stop using the std::iterator deprecated in C++17.


Version 3.3.0 [13 Sep 2022]
---------------------------
- Update Unicode data to 15.0.0.
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

UNILIB_VERSION := 3.3.0
UNILIB_VERSION := 3.3.1
UNILIB_UNICODE_VERSION := 15.0.0

UNILIB_OBJECTS := unicode uninorms unistrip utf8 utf16 version
2 changes: 1 addition & 1 deletion src/unilib/unicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#include "unicode.h"
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/unicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/uninorms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#include "uninorms.h"
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/uninorms.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/unistrip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#include "unistrip.h"
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/unistrip.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#pragma once
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/utf16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#include "utf16.h"
Expand Down
16 changes: 13 additions & 3 deletions src/unilib/utf16.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#pragma once
Expand Down Expand Up @@ -113,8 +113,13 @@ void utf16::decode(const std::u16string& str, std::u32string& decoded) {
decode(str.c_str(), decoded);
}

class utf16::string_decoder::iterator : public std::iterator<std::input_iterator_tag, char32_t> {
class utf16::string_decoder::iterator {
public:
using iterator_category = std::input_iterator_tag;
using value_type = char32_t;
using difference_type = ptrdiff_t;
using pointer = char32_t*;
using reference = char32_t&;
iterator(const char16_t* str) : codepoint(0), next(str) { operator++(); }
iterator(const iterator& it) : codepoint(it.codepoint), next(it.next) {}
iterator& operator++() { if (next) { codepoint = decode(next); if (!codepoint) next = nullptr; } return *this; }
Expand Down Expand Up @@ -145,8 +150,13 @@ utf16::string_decoder utf16::decoder(const std::u16string& str) {
return string_decoder(str.c_str());
}

class utf16::buffer_decoder::iterator : public std::iterator<std::input_iterator_tag, char32_t> {
class utf16::buffer_decoder::iterator {
public:
using iterator_category = std::input_iterator_tag;
using value_type = char32_t;
using difference_type = ptrdiff_t;
using pointer = char32_t*;
using reference = char32_t&;
iterator(const char16_t* str, size_t len) : codepoint(0), next(str), len(len) { operator++(); }
iterator(const iterator& it) : codepoint(it.codepoint), next(it.next), len(it.len) {}
iterator& operator++() { if (!len) next = nullptr; if (next) codepoint = decode(next, len); return *this; }
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/utf8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#include "utf8.h"
Expand Down
16 changes: 13 additions & 3 deletions src/unilib/utf8.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#pragma once
Expand Down Expand Up @@ -145,8 +145,13 @@ void utf8::decode(const std::string& str, std::u32string& decoded) {
decode(str.c_str(), decoded);
}

class utf8::string_decoder::iterator : public std::iterator<std::input_iterator_tag, char32_t> {
class utf8::string_decoder::iterator {
public:
using iterator_category = std::input_iterator_tag;
using value_type = char32_t;
using difference_type = ptrdiff_t;
using pointer = char32_t*;
using reference = char32_t&;
iterator(const char* str) : codepoint(0), next(str) { operator++(); }
iterator(const iterator& it) : codepoint(it.codepoint), next(it.next) {}
iterator& operator++() { if (next) { codepoint = decode(next); if (!codepoint) next = nullptr; } return *this; }
Expand Down Expand Up @@ -177,8 +182,13 @@ utf8::string_decoder utf8::decoder(const std::string& str) {
return string_decoder(str.c_str());
}

class utf8::buffer_decoder::iterator : public std::iterator<std::input_iterator_tag, char32_t> {
class utf8::buffer_decoder::iterator {
public:
using iterator_category = std::input_iterator_tag;
using value_type = char32_t;
using difference_type = ptrdiff_t;
using pointer = char32_t*;
using reference = char32_t&;
iterator(const char* str, size_t len) : codepoint(0), next(str), len(len) { operator++(); }
iterator(const iterator& it) : codepoint(it.codepoint), next(it.next), len(it.len) {}
iterator& operator++() { if (!len) next = nullptr; if (next) codepoint = decode(next, len); return *this; }
Expand Down
4 changes: 2 additions & 2 deletions src/unilib/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#include "version.h"
Expand All @@ -18,7 +18,7 @@ namespace unilib {

// Returns current version.
version version::current() {
return {3, 3, 0, ""};
return {3, 3, 1, ""};
}

} // namespace unilib
Expand Down
2 changes: 1 addition & 1 deletion src/unilib/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// UniLib version: 3.3.0
// UniLib version: 3.3.1
// Unicode version: 15.0.0

#pragma once
Expand Down

0 comments on commit 12660ae

Please sign in to comment.