xot 0.1.41 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +11 -0
- data/VERSION +1 -1
- data/include/xot/debug.h +2 -2
- data/include/xot/string.h +6 -0
- data/src/string.cpp +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9592ba7adfc21223d2bc9f0035665c4cd12c6ab194bfbb0d445510c908e56812
|
4
|
+
data.tar.gz: 40dd5584ff274a815e0791076216cd188df05b5e712eb156d7e52f62da20e9bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d3de874655db69b4a9e0a569de98ffb3d3bd80950602b8f27a1a6f024e673a6ebc641611067799569598373696eba1149d9359898116033b49630a8dba9915a
|
7
|
+
data.tar.gz: e5a5b77c96cb68ae8cd8d0c692fc4f6ccf326afb6f0827ca68d038a4dc9a5531a8b86c15aec0ec4f13f5317c590f647442c0ff7b2b98b9d25c74825535d0aede
|
data/ChangeLog.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2
|
data/include/xot/debug.h
CHANGED
data/include/xot/string.h
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
|
7
7
|
#include <stdarg.h>
|
8
8
|
#include <string>
|
9
|
+
#include <vector>
|
9
10
|
|
10
11
|
|
11
12
|
#define XOT_STRINGF(format, result) \
|
@@ -58,10 +59,15 @@ namespace Xot
|
|
58
59
|
};// String
|
59
60
|
|
60
61
|
|
62
|
+
typedef std::vector<String> StringList;
|
63
|
+
|
64
|
+
|
61
65
|
String stringf (const char* format, ...);
|
62
66
|
|
63
67
|
String stringf (const char* format, va_list args);
|
64
68
|
|
69
|
+
void split(StringList* result, const char* string, char separator = '\n');
|
70
|
+
|
65
71
|
template <typename T> String to_s (const T& val);
|
66
72
|
|
67
73
|
|
data/src/string.cpp
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
#include <stdio.h>
|
5
5
|
#include <algorithm>
|
6
6
|
#include <memory>
|
7
|
+
#include "xot/exception.h"
|
7
8
|
|
8
9
|
|
9
10
|
namespace Xot
|
@@ -110,6 +111,29 @@ namespace Xot
|
|
110
111
|
return NULL;
|
111
112
|
}
|
112
113
|
|
114
|
+
void
|
115
|
+
split (StringList* result, const char* string, char separator)
|
116
|
+
{
|
117
|
+
if (separator == '\0')
|
118
|
+
argument_error(__FILE__, __LINE__);
|
119
|
+
|
120
|
+
result->clear();
|
121
|
+
for (const char* p = string;;)
|
122
|
+
{
|
123
|
+
const char* psep = strchr(p, separator);
|
124
|
+
if (psep)
|
125
|
+
{
|
126
|
+
result->emplace_back(p, psep);
|
127
|
+
p = psep + 1;
|
128
|
+
}
|
129
|
+
else
|
130
|
+
{
|
131
|
+
result->emplace_back(p);
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
113
137
|
template <> String
|
114
138
|
to_s<int> (const int& val)
|
115
139
|
{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This library include some useful utility classes and functions for development
|
14
14
|
with C++.
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
|
-
rubygems_version: 3.4.
|
100
|
+
rubygems_version: 3.4.19
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: A Utility library for C++ developemt.
|