xot 0.1.41 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95d8ed01cbd15d8c102c45728dede62372c51da64883607fd5dc809c207121a8
4
- data.tar.gz: 4fe8834a66e6494df456541676239c0c158ae59b8173d3be52ee5dfac8dbd7bc
3
+ metadata.gz: 9592ba7adfc21223d2bc9f0035665c4cd12c6ab194bfbb0d445510c908e56812
4
+ data.tar.gz: 40dd5584ff274a815e0791076216cd188df05b5e712eb156d7e52f62da20e9bb
5
5
  SHA512:
6
- metadata.gz: f6e04c4802017b00f833e57776f429894b74bfdbe3d648a216ae50ec897bc4edb1a03622b95b5577662fbf041c1a68f2c66e5418f7ea398f14df7f178bdc34d5
7
- data.tar.gz: 9262d139d287e2ccdb7d6b044c90d821c7791f76e0ea0b26f44268c20c1b0161fd06f0526bb4d912a08817a90ddef261ab3fa2e9bd4ca3c860cd45656de8d268
6
+ metadata.gz: 8d3de874655db69b4a9e0a569de98ffb3d3bd80950602b8f27a1a6f024e673a6ebc641611067799569598373696eba1149d9359898116033b49630a8dba9915a
7
+ data.tar.gz: e5a5b77c96cb68ae8cd8d0c692fc4f6ccf326afb6f0827ca68d038a4dc9a5531a8b86c15aec0ec4f13f5317c590f647442c0ff7b2b98b9d25c74825535d0aede
data/ChangeLog.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # xot ChangeLog
2
2
 
3
3
 
4
+ ## [v0.2] - 2024-03-14
5
+
6
+ - v0.2
7
+
8
+
9
+ ## [v0.1.42] - 2024-02-07
10
+
11
+ - Add Xot::split()
12
+ - Fix compile error
13
+
14
+
4
15
  ## [v0.1.41] - 2023-12-09
5
16
 
6
17
  - Add ci?()
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.41
1
+ 0.2
data/include/xot/debug.h CHANGED
@@ -21,9 +21,9 @@ namespace Xot
21
21
 
22
22
  #else
23
23
 
24
- inline void dout(...) {}
24
+ inline void dout (...) {}
25
25
 
26
- inline void doutln(...) {}
26
+ inline void doutln (...) {}
27
27
 
28
28
  #endif
29
29
 
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.1.41
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: 2023-12-09 00:00:00.000000000 Z
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.10
100
+ rubygems_version: 3.4.19
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: A Utility library for C++ developemt.