Commit Graph

5 Commits

Author SHA1 Message Date
Marco Bubke
0549c6af97 Utils: Add std::string conversion constructor and operator to small string
Change-Id: Ia76d7647fc8d2c9b72bc5bce2e7a6e2c3fcc18cc
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-02 13:38:23 +00:00
Marco Bubke
390e2d164c Utils: Add iterator constructors to small string
Change-Id: Ib8fcacd5dc520842cf5cee73ea21c021221158ca
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-02 13:38:19 +00:00
Marco Bubke
b2c8d76156 Utils: Add constructor for character pointer
Change-Id: I12bd787caf911502a666de2c324bb74b8bd7b0aa
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-08 11:50:30 +00:00
Marco Bubke
e562af2c29 Utils: Rename isReference to isReadOnlyReference
There is implicit knowledge that the reference is read only in the code
so we should honor that and make is explicit.

Change-Id: I0d6eab6595ae1414ad2607760a2e02fd49bafd72
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-25 09:39:51 +00:00
Marco Bubke
1eb0c94f81 Utils: Add SmallString
SmallString is a very simple utf8 string class. It's purpose is performance.
It uses a short string opimization which provides 31 bytes of heap free
memory to save a 30 bytes long string plus null terminator. If the string
gets larger heap is allocated. The grow strategy is 1.5 to improve reuse
of allocated memory.

It uses optionally constexpr to provide string literals.

Change-Id: I7757fb51abfeca200d074cbfce2f1d99edc0ecb0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-17 15:07:01 +00:00