Skip to content

Commit

Permalink
expr.select_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 15, 2023
1 parent 281bb23 commit d0b60db
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions include/jsoncons_ext/jsonpath/json_location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,33 @@ namespace jsonpath {
}
};


template<class Json>
std::size_t delete(Json& instance, const basic_json_location<typename Json::char_type>& location)
{
std::size_t count = 0;

Json* p_current = std::addressof(instance);
for (const auto& element : location)
{
switch (element.element_kind())
{
case location_element_kind::name:
if (current.is_object())
{

}
break;
case location_element_kind::index:
break;
default:
break;
}
}
return count;
}


using json_location = basic_json_location<char>;
using wjson_location = basic_json_location<wchar_t>;
using path_element = basic_path_element<char,std::allocator<char>>;
Expand Down
1 change: 1 addition & 0 deletions include/jsoncons_ext/jsonpath/json_query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <jsoncons/json.hpp>
#include <jsoncons_ext/jsonpath/jsonpath_expression.hpp>
#include <jsoncons_ext/jsonpath/jsonpath_expr.hpp>

namespace jsoncons {
namespace jsonpath {
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ add_executable(unit_tests
jsonpath/src/jsonpath_json_query_tests.cpp
jsonpath/src/jsonpath_make_expression_tests.cpp
jsonpath/src/jsonpath_json_replace_tests.cpp
jsonpath/src/jsonpath_select_path_tests.cpp
jsonpath/src/jsonpath_select_paths_tests.cpp
jsonpath/src/jsonpath_test_suite.cpp
jsonpath/src/jsonpath_stateful_allocator_tests.cpp
jsonpointer/src/jsonpointer_flatten_tests.cpp
Expand Down

0 comments on commit d0b60db

Please sign in to comment.