xot 0.1.40 → 0.1.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +0 -1
- data/ChangeLog.md +13 -0
- data/VERSION +1 -1
- data/include/xot/debug.h +2 -2
- data/include/xot/string.h +6 -0
- data/lib/xot/rake/util.rb +5 -1
- data/lib/xot/rake.rb +1 -1
- 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: b661b7dceb26ab9ff2da740eee209953572ada82033e4be60554e8c9325b3068
|
4
|
+
data.tar.gz: '08c8cad2a61cc0dd6d143f0cdecedc0667e9623fa725c576d00a998b0451012f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c83a2695955207e0624a196d41df892f38837748ced52ff64086a47fcd10ba0a434a1575b139eda927a4d628cd845dce10226e9853b468ca86fc7c5c00fc6dc
|
7
|
+
data.tar.gz: 7a9761a6d883abe8c6272c9ecfb7b5279708de6b477fb12fca6464046de2039ebc591ddf6c1b058ab228ba507719a1a9e6c3509239bae9ba726c30809de99d67
|
data/.github/workflows/test.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
# xot ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v0.1.42] - 2024-02-07
|
5
|
+
|
6
|
+
- Add Xot::split()
|
7
|
+
- Fix compile error
|
8
|
+
|
9
|
+
|
10
|
+
## [v0.1.41] - 2023-12-09
|
11
|
+
|
12
|
+
- Add ci?()
|
13
|
+
- Trigger github actions on all pull_request
|
14
|
+
- Fix breaking depend.mf
|
15
|
+
|
16
|
+
|
4
17
|
## [v0.1.40] - 2023-11-09
|
5
18
|
|
6
19
|
- Use Gemfile to install gems for development instead of add_development_dependency in gemspec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.42
|
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/lib/xot/rake/util.rb
CHANGED
data/lib/xot/rake.rb
CHANGED
@@ -100,7 +100,7 @@ module Xot
|
|
100
100
|
sh %( #{cxx} -M #{cppflags} #{srcs.keys.join ' '} > #{depend} )
|
101
101
|
input = open(depend) {|f| f.read}
|
102
102
|
open(depend, 'w') do |output|
|
103
|
-
output << input.gsub(/\w+\.o/, src_dir + '/\0')
|
103
|
+
output << input.gsub(/\w+\.o\W/, src_dir + '/\0')
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
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.
|
4
|
+
version: 0.1.42
|
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-02-06 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.
|