Skip to content

Commit 0e7550a

Browse files
committed
merge duplicates
1 parent 46300e1 commit 0e7550a

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

src/yaml_c_wrapper.cpp

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -391,23 +391,6 @@ YAML_API void delete_node(YAMLNodeHandle handle) {
391391
delete static_cast<YAML::Node*>(handle);
392392
}
393393

394-
// === PARSING ===
395-
YAML_API YAMLNodeHandle parse_string(const char* yaml_str) {
396-
try {
397-
return new YAML::Node(YAML::Load(yaml_str));
398-
} catch (...) {
399-
return nullptr;
400-
}
401-
}
402-
403-
YAML_API YAMLNodeHandle parse_file(const char* filename) {
404-
try {
405-
return new YAML::Node(YAML::LoadFile(filename));
406-
} catch (...) {
407-
return nullptr;
408-
}
409-
}
410-
411394
// === TYPE CHECKS ===
412395
YAML_API bool is_scalar(YAMLNodeHandle handle) {
413396
return static_cast<YAML::Node*>(handle)->IsScalar();
@@ -452,9 +435,6 @@ YAML_API bool has_key(YAMLNodeHandle handle, const char* key) {
452435
YAML_API int size(YAMLNodeHandle handle) {
453436
return static_cast<YAML::Node*>(handle)->size();
454437
}
455-
YAML_API void delete_node(YAMLNodeHandle handle) {
456-
delete static_cast<YAML::Node*>(handle);
457-
}
458438

459439
// === PARSING ===
460440
YAML_API YAMLNodeHandle parse_string(const char* yaml_str) {
@@ -473,51 +453,6 @@ YAML_API YAMLNodeHandle parse_file(const char* filename) {
473453
}
474454
}
475455

476-
// === TYPE CHECKS ===
477-
YAML_API bool is_scalar(YAMLNodeHandle handle) {
478-
return static_cast<YAML::Node*>(handle)->IsScalar();
479-
}
480-
481-
YAML_API bool is_sequence(YAMLNodeHandle handle) {
482-
return static_cast<YAML::Node*>(handle)->IsSequence();
483-
}
484-
485-
YAML_API bool is_map(YAMLNodeHandle handle) {
486-
return static_cast<YAML::Node*>(handle)->IsMap();
487-
}
488-
489-
YAML_API bool is_null(YAMLNodeHandle handle) {
490-
return static_cast<YAML::Node*>(handle)->IsNull();
491-
}
492-
493-
// === ACCESS ===
494-
// equivalent to map[key]
495-
YAML_API YAMLNodeHandle get_key(YAMLNodeHandle handle, const char* key) {
496-
auto node = static_cast<YAML::Node*>(handle);
497-
auto child = (*node)[key];
498-
if (!child.IsDefined()) {
499-
return nullptr;
500-
}
501-
return new YAML::Node(child);
502-
}
503-
504-
YAML_API YAMLNodeHandle get_index(YAMLNodeHandle handle, int index) {
505-
auto node = static_cast<YAML::Node*>(handle);
506-
if (index < 0 || index >= node->size()) {
507-
return nullptr;
508-
}
509-
return new YAML::Node((*node)[index]);
510-
}
511-
512-
YAML_API bool has_key(YAMLNodeHandle handle, const char* key) {
513-
auto node = static_cast<YAML::Node*>(handle);
514-
return (*node)[key].IsDefined();
515-
}
516-
517-
YAML_API int size(YAMLNodeHandle handle) {
518-
return static_cast<YAML::Node*>(handle)->size();
519-
}
520-
521456
YAML_API char** get_keys(YAMLNodeHandle handle, int* out_count) {
522457
auto node = static_cast<YAML::Node*>(handle);
523458
if (!node->IsMap()) {

0 commit comments

Comments
 (0)