Commit Graph

91 Commits

Author SHA1 Message Date
Maxime Coste
e01a658cea Make use of strongly typed number to size_t conversion 2016-04-27 09:46:53 +01:00
Maxime Coste
8bd3395d4d Do not allow / in highlighter names as it is used for hierachies
/ are replaced with <slash> in the highlighter names.
Fixes #553
2016-02-13 12:59:27 +00:00
Maxime Coste
8d37a716fb Use a custom SSO aware string backend 2016-02-10 09:44:42 +00:00
Maxime Coste
94cbd5a837 More string usage cleanup 2016-02-05 09:13:07 +00:00
Maxime Coste
a8eddd03f0 String usage cleanups 2016-02-04 23:54:22 +00:00
Maxime Coste
ec91ea17fe Add a static const String::ms_empty empty string 2015-11-25 21:07:41 +00:00
Maxime Coste
a5c8437873 Remove unneeded conversion 2015-11-11 19:05:32 +00:00
Filip Szczepański
47e6eed7c9 Add Haiku support. 2015-09-24 22:36:29 +00:00
Maxime Coste
6bc5f8c3a3 Add simple markup support to generate display lines from strings
The syntax is simply {face} to enable the given face, use \{ to
escape a {, and \\ to escape a \.
2015-09-19 12:19:17 +01:00
Maxime Coste
a33c8d9677 Smaller sizeof for in place strings 2015-08-18 21:06:53 +01:00
Maxime Coste
f87dbe410f Add missing support for Codepoint in format 2015-07-14 13:47:51 +01:00
Maxime Coste
6870895374 Add support for hex formatting 2015-06-22 13:56:00 +01:00
Maxime Coste
f19bb4fe6d Port more code to use the format function instead of adhoc string concat 2015-06-01 19:06:35 +01:00
Maxime Coste
be9da616df Return a String in Backtrace::desc 2015-05-29 13:35:54 +01:00
Maxime Coste
993e842fdf Retreat ! go back to C++11 only code
This reverts commit b42de85031.
2015-05-26 18:42:09 +01:00
Maxime Coste
b42de85031 Migrate code to c++14 2015-05-25 13:51:17 +01:00
Maxime Coste
d7159a9af0 Add str_to_int_ifp that returns an Optional<int> instead of throwing 2015-05-01 18:47:22 +01:00
Maxime Coste
f6c7948c12 Add format_to allowing formating to an existing buffer 2015-04-22 13:19:46 +01:00
Maxime Coste
b5ab318a2d Always optimize StringView::strlen (recursive due to constexpr) 2015-04-07 23:21:14 +01:00
Maxime Coste
758bfe7284 number to string conversion avoids memory allocations 2015-03-31 13:53:40 +01:00
Maxime Coste
13a5af70ae Add a format function for printf like formatting 2015-03-30 23:05:24 +01:00
Maxime Coste
8761fc34f4 Always go through StringView to compare strings
That avoids creating temporary String needlessly
2015-03-30 19:59:08 +01:00
Maxime Coste
8439059758 Fix wrong implicit conversions from int/Codepoint to StringView 2015-03-30 13:33:46 +01:00
Maxime Coste
f2b8b1ae2b Fix compilation on clang 2015-03-12 13:04:53 +00:00
Maxime Coste
c81a5d03c5 String tweaks 2015-03-11 19:41:44 +00:00
Maxime Coste
3c1a325b6f Refactor String, use a common StringOps interface, hide std::string 2015-03-10 19:50:22 +00:00
Maxime Coste
6c65c5e080 Add docstrings to highlighters, displayed by addhl help 2015-02-19 13:54:03 +00:00
Maxime Coste
790e671f6c Replace some <cstring> function usage with c++ algorithms 2015-02-10 23:09:30 +00:00
Maxime Coste
7cdeb3d7f7 simplify echo code, avoid trailing spaces 2015-01-17 22:55:48 +00:00
Maxime Coste
b9c4fc2d8c Add size_t and float to_string overload, and _sv UDL 2015-01-13 13:47:46 +00:00
Maxime Coste
9f9156a752 Track String memory allocations 2015-01-09 13:57:21 +00:00
Maxime Coste
8cc96ec36b Add a join function for joining strings using a specific char 2014-12-28 11:16:51 +00:00
Maxime Coste
2852e0fbe5 Remove trailing blank lines 2014-12-23 23:00:20 +00:00
Maxime Coste
ebecd60eb8 Rework hashing, use a more extensible framework similar to n3876 proposal
std::hash specialization is a pain to work with, stop using that, and
just specialize a 'size_t hash_value(const T&)' free function.
2014-12-16 18:57:19 +00:00
Maxime Coste
2f2752cd1d Force inline StringView::{begin,end} 2014-12-09 13:56:05 +00:00
Maxime Coste
87d312b6d4 More string cleanups 2014-12-08 13:59:29 +00:00
Maxime Coste
9f4af93780 cleanup in string.hh 2014-12-08 13:46:07 +00:00
Maxime Coste
314d662c5f Change wrap_lines to return StringViews, move it to string.cc 2014-11-20 13:15:11 +00:00
Maxime Coste
1bd2260fa5 Import std::begin/std::end so that container utils work correctly with non std containers 2014-11-17 13:51:21 +00:00
Maxime Coste
3a817e2f96 Cleanup includes 2014-11-12 21:27:07 +00:00
Maxime Coste
97df59ddb7 Support single char StringView
remove single char escape function overload, add unescape function
2014-11-04 13:32:18 +00:00
Maxime Coste
69113e2711 Add a split function that does not take an escape and returns StringViews
When an escape character is not present, split can just return sub
strings of the parameter, so we can avoid duplicating the original
string data.
2014-10-19 16:27:36 +01:00
Maxime Coste
fa85f0fc32 Refactor regex uses, do not reference boost except in regex.hh 2014-10-13 13:14:23 +01:00
Maxime Coste
d55d041c6a Add support for interned strings
Use interned strings for Modification contents and word database.
Interned strings are guaranteed not to move in memory and are
reference counted.
2014-10-01 00:20:12 +01:00
Maxime Coste
6ba3017a8e Always inline a few more methods 2014-08-17 15:36:12 +01:00
Maxime Coste
1b54b65bb5 Add an operator[](CharCount) to String and StringView 2014-08-11 19:40:35 +01:00
Maxime Coste
8ee2aa9ba7 Use more StringView in string helper functions 2014-08-03 10:02:17 +01:00
Maxime Coste
f4d338e605 String::substr now returns a StringView 2014-05-11 12:44:51 +01:00
Maxime Coste
144a35be30 Fix clang compilation 2014-04-30 19:07:32 +01:00
Maxime Coste
53cb626f49 Add an expand_tabs string utility function 2014-04-28 19:49:00 +01:00