[gnote] Remove sharp::string_index_of
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Remove sharp::string_index_of
- Date: Sun, 22 Jan 2017 19:02:03 +0000 (UTC)
commit 7eb9b7d20264e257a1b4f5a67b13f0fe6655c9b8
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Jan 22 21:00:35 2017 +0200
Remove sharp::string_index_of
src/sharp/string.cpp | 34 ----------------------------------
src/sharp/string.hpp | 2 --
2 files changed, 0 insertions(+), 36 deletions(-)
---
diff --git a/src/sharp/string.cpp b/src/sharp/string.cpp
index b7c3ea9..467e633 100644
--- a/src/sharp/string.cpp
+++ b/src/sharp/string.cpp
@@ -180,38 +180,4 @@ namespace sharp {
return source.rfind(search);
}
-
- int string_index_of(const std::string & source, const std::string & search)
- {
- // C# returns index 0 if looking for the empty string
- if(search.empty()) {
- return 0;
- }
- boost::iterator_range<std::string::const_iterator> iter
- = boost::find_first(source, search);
- if(iter.begin() == source.end()) {
- // NOT FOUND
- return -1;
- }
- return iter.begin() - source.begin();
- }
-
-
- int string_index_of(const std::string & source, const std::string & search, int start_at)
- {
- std::string source2(source.begin() + start_at, source.end());
- boost::iterator_range<std::string::const_iterator> iter
- = boost::find_first(source2, search);
- // C# returns index 0 if looking for the empty string
- if(search.empty()) {
- // Note: check this after 'find_first' so boost will throw an exception if start_at > source.size()
- return start_at;
- }
- if(iter.begin() == source2.end()) {
- // NOT FOUND
- return -1;
- }
- return iter.begin() - source2.begin() + start_at;
- }
-
}
diff --git a/src/sharp/string.hpp b/src/sharp/string.hpp
index c7136ef..8735673 100644
--- a/src/sharp/string.hpp
+++ b/src/sharp/string.hpp
@@ -66,8 +66,6 @@ namespace sharp {
Glib::ustring string_trim(const Glib::ustring & source);
Glib::ustring string_trim(const Glib::ustring & source, const Glib::ustring & set_of_char);
- int string_index_of(const std::string & source, const std::string & with);
- int string_index_of(const std::string & source, const std::string & with, int);
int string_last_index_of(const Glib::ustring & source, const Glib::ustring & search);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]