yerba 0.9.2-aarch64-linux-gnu → 0.10.0-aarch64-linux-gnu
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/README.md +34 -17
- data/exe/aarch64-linux-gnu/yerba +0 -0
- data/ext/yerba/include/yerba.h +56 -34
- data/ext/yerba/yerba.c +268 -186
- data/lib/yerba/3.2/yerba.so +0 -0
- data/lib/yerba/3.3/yerba.so +0 -0
- data/lib/yerba/3.4/yerba.so +0 -0
- data/lib/yerba/4.0/yerba.so +0 -0
- data/lib/yerba/collection.rb +4 -4
- data/lib/yerba/document.rb +134 -0
- data/lib/yerba/formatting.rb +1 -0
- data/lib/yerba/location.rb +8 -1
- data/lib/yerba/map.rb +16 -6
- data/lib/yerba/node.rb +41 -0
- data/lib/yerba/query_result.rb +33 -10
- data/lib/yerba/scalar.rb +29 -0
- data/lib/yerba/selector.rb +3 -1
- data/lib/yerba/sequence.rb +38 -33
- data/lib/yerba/version.rb +1 -1
- data/rust/Cargo.lock +1 -1
- data/rust/Cargo.toml +1 -1
- data/rust/src/commands/get.rs +12 -12
- data/rust/src/commands/init.rs +8 -8
- data/rust/src/commands/insert.rs +4 -18
- data/rust/src/commands/location.rs +2 -0
- data/rust/src/commands/mod.rs +34 -6
- data/rust/src/commands/move_item.rs +1 -1
- data/rust/src/commands/move_key.rs +8 -8
- data/rust/src/commands/rename.rs +1 -1
- data/rust/src/commands/selectors.rs +1 -1
- data/rust/src/commands/set.rs +14 -6
- data/rust/src/document/condition.rs +25 -25
- data/rust/src/document/delete.rs +57 -43
- data/rust/src/document/get.rs +91 -82
- data/rust/src/document/insert.rs +77 -77
- data/rust/src/document/mod.rs +138 -64
- data/rust/src/document/nodes.rs +162 -0
- data/rust/src/document/schema.rs +8 -8
- data/rust/src/document/set.rs +49 -26
- data/rust/src/document/sort.rs +54 -54
- data/rust/src/document/style.rs +50 -49
- data/rust/src/document/unique.rs +5 -5
- data/rust/src/error.rs +8 -4
- data/rust/src/ffi.rs +218 -106
- data/rust/src/json.rs +62 -2
- data/rust/src/lib.rs +2 -1
- data/rust/src/main.rs +2 -1
- data/rust/src/selector.rs +48 -7
- data/rust/src/syntax.rs +449 -56
- data/rust/src/validation.rs +5 -3
- data/rust/src/yerbafile.rs +124 -76
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 118917ba4d0025450859477d389d2c1f086abd38e03afc43660ce4872f9b84a9
|
|
4
|
+
data.tar.gz: af5d4cdb8c867bf27841cec7423ac1ae3865b406d64d8b8759cc13508e41f965
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f425c1681c868c48ecf6947dce6fd7dfcd5e43cbf071dddded0ed54a4f73210b527f22eea2b323574272a8db913ff63f93ea6eb5436c0b6cc7e7c1d9ac76692b
|
|
7
|
+
data.tar.gz: 13cef239ee5ede0fcc6898d9e8209eaa4b88aabb91fa80638612fbb8d9dde761f6bbf0540706a8e87e90f86126d6dcde47a03ed24e6cdb97c4a67bdaf9879ae8
|
data/README.md
CHANGED
|
@@ -47,7 +47,7 @@ Use `yerba` as a library in your Rust project:
|
|
|
47
47
|
|
|
48
48
|
```toml
|
|
49
49
|
[dependencies]
|
|
50
|
-
yerba = "0.
|
|
50
|
+
yerba = "0.10"
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
```rust
|
|
@@ -93,9 +93,10 @@ Selectors let you address any node in a YAML document:
|
|
|
93
93
|
| Pattern | Meaning | Example |
|
|
94
94
|
|-------------------|---------------------|----------------------------|
|
|
95
95
|
| `key` | A single key | `"database.host"` |
|
|
96
|
-
| `key.nested` | Nested
|
|
96
|
+
| `key.nested` | Nested keys | `"database.settings.pool"` |
|
|
97
97
|
| `[]` | All items in array | `"[].title"` |
|
|
98
98
|
| `[N]` | Item at index | `"[0].title"` |
|
|
99
|
+
| `[-N]` | Item from the end | `"[-1].title"` |
|
|
99
100
|
| `*` | All values in a map | `"database.*"` |
|
|
100
101
|
| `[].key[].nested` | Nested array access | `"[].speakers[].name"` |
|
|
101
102
|
|
|
@@ -149,14 +150,14 @@ yerba get videos.yml "[]" --condition ".speakers contains Matz" --raw
|
|
|
149
150
|
|
|
150
151
|
### `set`
|
|
151
152
|
|
|
152
|
-
Update an existing value at a
|
|
153
|
+
Update an existing value at a selector. The original quote style is preserved automatically, if a value was double-quoted before, it stays double-quoted after the edit.
|
|
153
154
|
|
|
154
155
|
```bash
|
|
155
156
|
yerba set config.yml "database.host" "0.0.0.0"
|
|
156
157
|
yerba set videos.yml "[0].title" "New Title"
|
|
157
158
|
```
|
|
158
159
|
|
|
159
|
-
Use `--if-exists` to only set the value when the
|
|
160
|
+
Use `--if-exists` to only set the value when the selector already exists, or `--if-missing` to only set it when the selector does not exist:
|
|
160
161
|
|
|
161
162
|
```bash
|
|
162
163
|
yerba set config.yml "database.host" "0.0.0.0" --if-exists
|
|
@@ -189,7 +190,7 @@ Use `--all` to update all nodes matching a wildcard selector:
|
|
|
189
190
|
yerba set videos.yml "[].description" "" --all
|
|
190
191
|
```
|
|
191
192
|
|
|
192
|
-
Values are written in the quote style already at the
|
|
193
|
+
Values are written in the quote style already at the selector, which keeps string edits tidy. A value is quoted anyway when writing it plain would not read back as the string you passed, so `yes` becomes `"yes"` and `12345` becomes `"12345"` — whatever the field held before. Use `--plain` to write a YAML literal instead:
|
|
193
194
|
|
|
194
195
|
```bash
|
|
195
196
|
yerba set config.yml "database.replica" null --plain
|
|
@@ -469,10 +470,14 @@ Output:
|
|
|
469
470
|
"end_line": 2,
|
|
470
471
|
"end_column": 19,
|
|
471
472
|
"start_offset": 22,
|
|
472
|
-
"end_offset": 32
|
|
473
|
+
"end_offset": 32,
|
|
474
|
+
"start_character_column": 9,
|
|
475
|
+
"end_character_column": 19
|
|
473
476
|
}
|
|
474
477
|
```
|
|
475
478
|
|
|
479
|
+
Lines are 1-based and columns are 0-based, like Prism. `start_column` and `end_column` count bytes, `start_character_column` and `end_character_column` count characters, and offsets are byte offsets into the file.
|
|
480
|
+
|
|
476
481
|
### `schema`
|
|
477
482
|
|
|
478
483
|
Validate YAML files against a JSON schema:
|
|
@@ -482,7 +487,7 @@ yerba schema data/speakers.yml --schema lib/schemas/speaker_schema.json
|
|
|
482
487
|
yerba schema "data/**/videos.yml" --schema lib/schemas/video_schema.json
|
|
483
488
|
```
|
|
484
489
|
|
|
485
|
-
Use `--
|
|
490
|
+
Use `--selector` to scope validation to a specific selector (e.g. validate each item in an array):
|
|
486
491
|
|
|
487
492
|
```bash
|
|
488
493
|
yerba schema data/speakers.yml --schema speaker_schema.json --selector "[]"
|
|
@@ -579,11 +584,11 @@ rules:
|
|
|
579
584
|
- files: "data/**/videos.yml"
|
|
580
585
|
pipeline:
|
|
581
586
|
- quote_style:
|
|
582
|
-
|
|
587
|
+
selector: "[].speakers"
|
|
583
588
|
value_style: plain
|
|
584
589
|
|
|
585
590
|
- sort_keys:
|
|
586
|
-
|
|
591
|
+
selector: "[]"
|
|
587
592
|
order:
|
|
588
593
|
- id
|
|
589
594
|
- title
|
|
@@ -592,7 +597,7 @@ rules:
|
|
|
592
597
|
- files: "data/speakers.yml"
|
|
593
598
|
pipeline:
|
|
594
599
|
- sort_keys:
|
|
595
|
-
|
|
600
|
+
selector: "[]"
|
|
596
601
|
order:
|
|
597
602
|
- name
|
|
598
603
|
- slug
|
|
@@ -602,13 +607,15 @@ rules:
|
|
|
602
607
|
by: name
|
|
603
608
|
```
|
|
604
609
|
|
|
610
|
+
Rules and steps take a `selector` to scope them. `path` is still accepted as the older name for it.
|
|
611
|
+
|
|
605
612
|
Available pipeline steps:
|
|
606
613
|
|
|
607
|
-
- `quote_style` Enforce quote style on keys and/or values, optionally scoped by
|
|
614
|
+
- `quote_style` Enforce quote style on keys and/or values, optionally scoped by selector
|
|
608
615
|
- `collection_style` Enforce flow or block style on collections
|
|
609
616
|
- `sequence_indent` Enforce compact or indented sequence style
|
|
610
617
|
- `sort_keys` Reorder keys to match a predefined list
|
|
611
|
-
- `sort` Sort sequence items by field(s)
|
|
618
|
+
- `sort` Sort sequence items by field(s), `by: ".date,.start_time"` or `by: ".date .start_time"` for tie-breakers
|
|
612
619
|
- `blank_lines` Enforce blank lines between sequence entries, optionally limited to named map keys with `before` and to non-empty values with `skip_empty`
|
|
613
620
|
- `set` Set a value (supports conditions, and `plain: true` for YAML literals)
|
|
614
621
|
- `insert` Insert a new key or sequence item (`plain: true` for YAML literals and fragments)
|
|
@@ -617,8 +624,8 @@ Available pipeline steps:
|
|
|
617
624
|
- `remove` Remove an item from a sequence
|
|
618
625
|
- `directives` Add or remove the document start marker (`---`), with optional `max` validation
|
|
619
626
|
- `unique` Find or remove duplicate items in a sequence
|
|
620
|
-
- `schema` Validate against a JSON schema (with optional `
|
|
621
|
-
- `escapes` Spell escaped characters literally where the quote style can carry them (with optional `
|
|
627
|
+
- `schema` Validate against a JSON schema (with optional `selector` for scoping)
|
|
628
|
+
- `escapes` Spell escaped characters literally where the quote style can carry them (with optional `selector` for scoping)
|
|
622
629
|
- `final_newline` Enforce exact number of trailing newlines (`count: 1` by default, strips extras)
|
|
623
630
|
|
|
624
631
|
This makes it easy to enforce project-wide YAML conventions in CI:
|
|
@@ -747,7 +754,7 @@ document["database"]["host"].value # => "localhost"
|
|
|
747
754
|
document["database.host"].value # => "localhost" (same thing)
|
|
748
755
|
```
|
|
749
756
|
|
|
750
|
-
The returned object type depends on what's at the
|
|
757
|
+
The returned object type depends on what's at the selector:
|
|
751
758
|
|
|
752
759
|
```ruby
|
|
753
760
|
document["database"] # => Yerba::Map
|
|
@@ -900,9 +907,14 @@ document.sort(by: :name, order: ["Charlie", "Bob", "Alice"])
|
|
|
900
907
|
document.sort("tags")
|
|
901
908
|
document.sort("tags", order: :desc)
|
|
902
909
|
document.sort("tags", order: ["rust", "ruby", "go"])
|
|
910
|
+
document.sort("tags", order: "rust,ruby,go")
|
|
911
|
+
document.sort(by: [:date, :start_time])
|
|
912
|
+
document.sort(by: ".date .start_time")
|
|
903
913
|
```
|
|
904
914
|
|
|
905
|
-
The `by:` option accepts symbols, strings, or dot-prefixed strings (`:name`, `"name"`, `".name"`).
|
|
915
|
+
The `by:` option accepts symbols, strings, or dot-prefixed strings (`:name`, `"name"`, `".name"`). Several fields, separated by commas or spaces or given as an Array, sort by the first and break ties with the next.
|
|
916
|
+
|
|
917
|
+
The `order:` option is `:asc`, `:desc`, or an explicit order of values as an Array or comma-separated String.
|
|
906
918
|
|
|
907
919
|
### Querying
|
|
908
920
|
|
|
@@ -1038,8 +1050,12 @@ loc.end_line # => 2
|
|
|
1038
1050
|
loc.end_column # => 19
|
|
1039
1051
|
loc.start_offset # => 22
|
|
1040
1052
|
loc.end_offset # => 32
|
|
1053
|
+
loc.start_character_column # => 9
|
|
1054
|
+
loc.end_character_column # => 19
|
|
1041
1055
|
```
|
|
1042
1056
|
|
|
1057
|
+
Lines are 1-based and columns are 0-based, matching `Prism::Location`. `start_column` and `end_column` count bytes, `start_character_column` and `end_character_column` count characters, so they differ on lines with non-ASCII text before the value.
|
|
1058
|
+
|
|
1043
1059
|
You can also get a location by selector string:
|
|
1044
1060
|
|
|
1045
1061
|
```ruby
|
|
@@ -1167,7 +1183,7 @@ scalars.first.document.save!
|
|
|
1167
1183
|
|
|
1168
1184
|
### Parsing Selectors
|
|
1169
1185
|
|
|
1170
|
-
`Yerba::Selector` splits a selector into its segments, using the same parser as the rest of Yerba. Keys are Strings, indexes Integers, `[]` is `:all_items` and `*` is `:all_keys`:
|
|
1186
|
+
`Yerba::Selector` splits a selector into its segments, using the same parser as the rest of Yerba. Keys are Strings, indexes Integers (negative from the end), `[]` is `:all_items` and `*` is `:all_keys`:
|
|
1171
1187
|
|
|
1172
1188
|
```ruby
|
|
1173
1189
|
selector = Yerba::Selector.parse("[3].talks[1]")
|
|
@@ -1178,6 +1194,7 @@ selector.join("speakers", 0).to_s # => "[3].talks[1].speakers[0]"
|
|
|
1178
1194
|
|
|
1179
1195
|
Yerba::Selector.parse("[].speakers[]").segments # => [:all_items, "speakers", :all_items]
|
|
1180
1196
|
Yerba::Selector.parse(".title").relative? # => true
|
|
1197
|
+
Yerba::Selector.parse("tags[-1]").segments # => ["tags", -1]
|
|
1181
1198
|
|
|
1182
1199
|
Yerba::Selector.build([3, "talks", 1]).to_s # => "[3].talks[1]"
|
|
1183
1200
|
```
|
data/exe/aarch64-linux-gnu/yerba
CHANGED
|
Binary file
|
data/ext/yerba/include/yerba.h
CHANGED
|
@@ -46,6 +46,8 @@ typedef struct YerbaLocation {
|
|
|
46
46
|
uintptr_t start_column;
|
|
47
47
|
uintptr_t end_line;
|
|
48
48
|
uintptr_t end_column;
|
|
49
|
+
uintptr_t start_character_column;
|
|
50
|
+
uintptr_t end_character_column;
|
|
49
51
|
} YerbaLocation;
|
|
50
52
|
|
|
51
53
|
typedef struct YerbaGetResult {
|
|
@@ -64,6 +66,22 @@ typedef struct YerbaResult {
|
|
|
64
66
|
char *error;
|
|
65
67
|
} YerbaResult;
|
|
66
68
|
|
|
69
|
+
typedef struct YerbaNodeRecord {
|
|
70
|
+
intptr_t parent;
|
|
71
|
+
enum NodeType node_type;
|
|
72
|
+
char *selector;
|
|
73
|
+
char *key_name;
|
|
74
|
+
struct YerbaTypedValue value;
|
|
75
|
+
bool has_value;
|
|
76
|
+
struct YerbaLocation location;
|
|
77
|
+
struct YerbaLocation key_location;
|
|
78
|
+
} YerbaNodeRecord;
|
|
79
|
+
|
|
80
|
+
typedef struct YerbaNodeList {
|
|
81
|
+
struct YerbaNodeRecord *records;
|
|
82
|
+
uintptr_t length;
|
|
83
|
+
} YerbaNodeList;
|
|
84
|
+
|
|
67
85
|
struct YerbaParseResult yerba_document_parse_file(const char *path);
|
|
68
86
|
|
|
69
87
|
struct YerbaParseResult yerba_document_parse(const char *content);
|
|
@@ -72,33 +90,33 @@ uint64_t yerba_document_generation(const struct Document *document);
|
|
|
72
90
|
|
|
73
91
|
void yerba_document_free(struct Document *document);
|
|
74
92
|
|
|
75
|
-
struct YerbaGetResult yerba_document_get(const struct Document *document, const char *
|
|
93
|
+
struct YerbaGetResult yerba_document_get(const struct Document *document, const char *selector);
|
|
76
94
|
|
|
77
95
|
/**
|
|
78
96
|
* Caller must free with yerba_string_free.
|
|
79
97
|
*/
|
|
80
|
-
char *yerba_document_source(const struct Document *document, const char *
|
|
98
|
+
char *yerba_document_source(const struct Document *document, const char *selector);
|
|
81
99
|
|
|
82
100
|
/**
|
|
83
101
|
* Caller must free with yerba_string_free.
|
|
84
102
|
*/
|
|
85
|
-
char *yerba_document_get_value(const struct Document *document, const char *
|
|
103
|
+
char *yerba_document_get_value(const struct Document *document, const char *selector);
|
|
86
104
|
|
|
87
105
|
/**
|
|
88
106
|
* Caller must free with yerba_string_free.
|
|
89
107
|
*/
|
|
90
108
|
char *yerba_document_selectors(const struct Document *document);
|
|
91
109
|
|
|
92
|
-
char *yerba_document_resolve_selectors(const struct Document *document, const char *
|
|
110
|
+
char *yerba_document_resolve_selectors(const struct Document *document, const char *selector);
|
|
93
111
|
|
|
94
|
-
bool yerba_selector_has_wildcard(const char *
|
|
112
|
+
bool yerba_selector_has_wildcard(const char *selector);
|
|
95
113
|
|
|
96
114
|
/**
|
|
97
115
|
* Parses a selector into JSON: `{"relative": bool, "segments": [...]}`.
|
|
98
116
|
*
|
|
99
|
-
* Keys are encoded as strings, indexes as integers, `[]` as `{"all": "items"}` and `*` as `{"all": "keys"}`.
|
|
117
|
+
* Keys are encoded as strings, indexes as integers (negative from the end), `[]` as `{"all": "items"}` and `*` as `{"all": "keys"}`.
|
|
100
118
|
*/
|
|
101
|
-
char *yerba_selector_parse(const char *
|
|
119
|
+
char *yerba_selector_parse(const char *selector);
|
|
102
120
|
|
|
103
121
|
/**
|
|
104
122
|
* Builds a selector string from a JSON array of segments, encoded like `yerba_selector_parse` returns them.
|
|
@@ -106,43 +124,43 @@ char *yerba_selector_parse(const char *path);
|
|
|
106
124
|
char *yerba_selector_build(const char *segments_json,
|
|
107
125
|
bool relative);
|
|
108
126
|
|
|
109
|
-
char *yerba_document_keys(const struct Document *document, const char *
|
|
127
|
+
char *yerba_document_keys(const struct Document *document, const char *selector);
|
|
110
128
|
|
|
111
|
-
char *yerba_document_get_quote_style(const struct Document *document, const char *
|
|
129
|
+
char *yerba_document_get_quote_style(const struct Document *document, const char *selector);
|
|
112
130
|
|
|
113
131
|
struct YerbaResult yerba_document_set_quote_style(struct Document *document,
|
|
114
|
-
const char *
|
|
132
|
+
const char *selector,
|
|
115
133
|
const char *style);
|
|
116
134
|
|
|
117
|
-
char *yerba_document_get_collection_style(const struct Document *document, const char *
|
|
135
|
+
char *yerba_document_get_collection_style(const struct Document *document, const char *selector);
|
|
118
136
|
|
|
119
137
|
struct YerbaResult yerba_document_set_collection_style(struct Document *document,
|
|
120
|
-
const char *
|
|
138
|
+
const char *selector,
|
|
121
139
|
const char *style);
|
|
122
140
|
|
|
123
|
-
char *yerba_document_get_sequence_indent(const struct Document *document, const char *
|
|
141
|
+
char *yerba_document_get_sequence_indent(const struct Document *document, const char *selector);
|
|
124
142
|
|
|
125
143
|
struct YerbaResult yerba_document_set_sequence_indent(struct Document *document,
|
|
126
|
-
const char *
|
|
144
|
+
const char *selector,
|
|
127
145
|
const char *style);
|
|
128
146
|
|
|
129
147
|
char *yerba_validate_condition(const char *condition, bool item_context);
|
|
130
148
|
|
|
131
149
|
bool yerba_document_evaluate_condition(const struct Document *document,
|
|
132
|
-
const char *
|
|
150
|
+
const char *parent_selector,
|
|
133
151
|
const char *condition);
|
|
134
152
|
|
|
135
|
-
bool yerba_document_exists(const struct Document *document, const char *
|
|
153
|
+
bool yerba_document_exists(const struct Document *document, const char *selector);
|
|
136
154
|
|
|
137
|
-
bool yerba_document_valid_selector(const struct Document *document, const char *
|
|
155
|
+
bool yerba_document_valid_selector(const struct Document *document, const char *selector);
|
|
138
156
|
|
|
139
157
|
char *yerba_document_find(const struct Document *document,
|
|
140
|
-
const char *
|
|
158
|
+
const char *selector,
|
|
141
159
|
const char *condition,
|
|
142
160
|
const char *select);
|
|
143
161
|
|
|
144
162
|
struct YerbaResult yerba_document_set(struct Document *document,
|
|
145
|
-
const char *
|
|
163
|
+
const char *selector,
|
|
146
164
|
const char *value,
|
|
147
165
|
uintptr_t value_length,
|
|
148
166
|
enum YerbaValueType value_type,
|
|
@@ -150,7 +168,7 @@ struct YerbaResult yerba_document_set(struct Document *document,
|
|
|
150
168
|
bool all);
|
|
151
169
|
|
|
152
170
|
struct YerbaResult yerba_document_insert(struct Document *document,
|
|
153
|
-
const char *
|
|
171
|
+
const char *selector,
|
|
154
172
|
const char *value,
|
|
155
173
|
uintptr_t value_length,
|
|
156
174
|
enum YerbaValueType value_type,
|
|
@@ -161,28 +179,28 @@ struct YerbaResult yerba_document_insert(struct Document *document,
|
|
|
161
179
|
int64_t at);
|
|
162
180
|
|
|
163
181
|
struct YerbaResult yerba_document_insert_object(struct Document *document,
|
|
164
|
-
const char *
|
|
182
|
+
const char *selector,
|
|
165
183
|
const char *json,
|
|
166
184
|
const char *before,
|
|
167
185
|
const char *after,
|
|
168
186
|
int64_t at);
|
|
169
187
|
|
|
170
|
-
struct YerbaResult yerba_document_delete(struct Document *document, const char *
|
|
188
|
+
struct YerbaResult yerba_document_delete(struct Document *document, const char *selector);
|
|
171
189
|
|
|
172
190
|
struct YerbaResult yerba_document_insert_objects(struct Document *document,
|
|
173
|
-
const char *
|
|
191
|
+
const char *selector,
|
|
174
192
|
const char *json);
|
|
175
193
|
|
|
176
194
|
struct YerbaResult yerba_document_remove(struct Document *document,
|
|
177
|
-
const char *
|
|
195
|
+
const char *selector,
|
|
178
196
|
const char *value);
|
|
179
197
|
|
|
180
198
|
struct YerbaResult yerba_document_remove_at(struct Document *document,
|
|
181
|
-
const char *
|
|
199
|
+
const char *selector,
|
|
182
200
|
uintptr_t index);
|
|
183
201
|
|
|
184
202
|
struct YerbaResult yerba_document_move_item(struct Document *document,
|
|
185
|
-
const char *
|
|
203
|
+
const char *selector,
|
|
186
204
|
uintptr_t from,
|
|
187
205
|
uintptr_t to);
|
|
188
206
|
|
|
@@ -191,26 +209,26 @@ struct YerbaResult yerba_document_rename(struct Document *document,
|
|
|
191
209
|
const char *dest);
|
|
192
210
|
|
|
193
211
|
struct YerbaResult yerba_document_sort(struct Document *document,
|
|
194
|
-
const char *
|
|
212
|
+
const char *selector,
|
|
195
213
|
const char *by,
|
|
196
214
|
bool case_sensitive);
|
|
197
215
|
|
|
198
216
|
struct YerbaResult yerba_document_reorder(struct Document *document,
|
|
199
|
-
const char *
|
|
217
|
+
const char *selector,
|
|
200
218
|
const char *by,
|
|
201
219
|
const char *order_csv);
|
|
202
220
|
|
|
203
221
|
struct YerbaResult yerba_document_sort_keys(struct Document *document,
|
|
204
|
-
const char *
|
|
222
|
+
const char *selector,
|
|
205
223
|
const char *order);
|
|
206
224
|
|
|
207
225
|
struct YerbaResult yerba_document_quote_style(struct Document *document,
|
|
208
|
-
const char *
|
|
226
|
+
const char *selector,
|
|
209
227
|
const char *key_style,
|
|
210
228
|
const char *value_style);
|
|
211
229
|
|
|
212
230
|
struct YerbaResult yerba_document_blank_lines(struct Document *document,
|
|
213
|
-
const char *
|
|
231
|
+
const char *selector,
|
|
214
232
|
uintptr_t count);
|
|
215
233
|
|
|
216
234
|
/**
|
|
@@ -237,14 +255,18 @@ void yerba_string_free(char *s);
|
|
|
237
255
|
|
|
238
256
|
void yerba_result_free(struct YerbaResult result);
|
|
239
257
|
|
|
258
|
+
struct YerbaNodeList yerba_document_nodes(const struct Document *document);
|
|
259
|
+
|
|
260
|
+
void yerba_node_list_free(struct YerbaNodeList list);
|
|
261
|
+
|
|
240
262
|
void yerba_get_result_free(struct YerbaGetResult result);
|
|
241
263
|
|
|
242
|
-
struct YerbaTypedList yerba_glob_get(const char *glob_pattern, const char *
|
|
264
|
+
struct YerbaTypedList yerba_glob_get(const char *glob_pattern, const char *selector);
|
|
243
265
|
|
|
244
|
-
struct YerbaTypedList yerba_document_get_all(const struct Document *document, const char *
|
|
266
|
+
struct YerbaTypedList yerba_document_get_all(const struct Document *document, const char *selector);
|
|
245
267
|
|
|
246
268
|
struct YerbaTypedList yerba_glob_find(const char *glob_pattern,
|
|
247
|
-
const char *
|
|
269
|
+
const char *selector,
|
|
248
270
|
const char *condition,
|
|
249
271
|
const char *select);
|
|
250
272
|
|