Skip to content

Commit

Permalink
Changed the proto output to write one file per top level category
Browse files Browse the repository at this point in the history
  • Loading branch information
klingbolt committed Sep 25, 2024
1 parent c6b8caf commit ab61a52
Show file tree
Hide file tree
Showing 58 changed files with 50 additions and 40 deletions.
2 changes: 1 addition & 1 deletion xml_converter/integration_tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def diff_dirs(actual_output_dir: str, expected_output_dir: str) -> bool:
diff: List[str]
if file_to_diff.endswith(".xml"):
diff = compare_text_files(expected_file, actual_file)
elif file_to_diff.endswith(".data") or file_to_diff.endswith(".bin") or file_to_diff.endswith(".guildp"):
elif file_to_diff.endswith(".data") or file_to_diff.endswith(".bin") or file_to_diff.endswith(".guildpoint"):
diff = compare_protos(actual_file, expected_file)
elif file_to_diff.endswith(".trl"):
diff = []
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.
My Category 2B\�)Cf�RC{�WC0B(��“^�
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.
My Category 2 2B\�)Cf�RC{�WCB(�i�4 1b
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

0
My Category 3 2B\�)Cf�RC{�WC0B(�i�5 1b
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.
My Category 4 2B\�)Cf�RC{�WCB(�i�6 1b
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

,
My Category 2B\�)Cf�RC{�WCB(��“^�
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

,
My Category 2B\�)Cf�RC{�WCB(��“^�
�
Nested Level Onef
Nested Level Two3
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

I 2B\�)Cf�RC{�WC 2B\�*Cf�RC{�WC 2B\�)Cf�SC{�WCB(��“^�
Expand Down
Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

,
My Category 2B\�)Cf�RC{�WCB(��“^�
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.
My Category 2B\�)Cf�RC{�WC0B(��“^�
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.
My Category 2 2B\�)Cf�RC{�WCB(�i�4 1b
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

0
My Category 3 2B\�)Cf�RC{�WC0B(�i�5 1b
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.
My Category 4 2B\�)Cf�RC{�WCB(�i�6 1b
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

,
My Category 2B\�)Cf�RC{�WCB(��“^�
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

,
My Category 2B\�)Cf�RC{�WCB(��“^�
�
Nested Level Onef
Nested Level Two3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

 2B\�)Cf�RC{�WCB(��“^�
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

 2B\�)Cf�RC{�WCB(��“^�
a@ 2B\�)Cf�RC{�WCBp,Tԅ߈� 2B\�)Cf�RC{�WCB��ܸ�xj� 2B\�)Cf�RC{�WCB,���j@:
Expand Down
20 changes: 11 additions & 9 deletions xml_converter/src/packaging_protobin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ void _write_protobuf_file(

void write_protobuf_file(
const string& marker_pack_root_directory,
const StringHierarchy& category_filter,
const map<string, Category>* marker_categories,
const vector<Parseable*>* parsed_pois) {
std::map<string, std::vector<Parseable*>> category_to_pois;
Expand All @@ -234,13 +233,16 @@ void write_protobuf_file(
std::cout << "Unknown type" << std::endl;
}
}

_write_protobuf_file(
join_file_paths(state.marker_pack_root_directory, "markers.bin"),
category_filter,
marker_categories,
category_to_pois,
&state);
for (auto iterator = marker_categories->begin(); iterator != marker_categories->end(); iterator++){
StringHierarchy category_filter;
category_filter.add_path({iterator->first}, true);
_write_protobuf_file(
join_file_paths(state.marker_pack_root_directory, iterator->first + ".guildpoint"),
category_filter,
marker_categories,
category_to_pois,
&state);
}
}

// Write protobuf per map id
Expand Down Expand Up @@ -269,7 +271,7 @@ void write_protobuf_file_per_map_id(
}

for (auto iterator = mapid_to_category_to_pois.begin(); iterator != mapid_to_category_to_pois.end(); iterator++) {
string output_filepath = join_file_paths(state.marker_pack_root_directory, to_string(iterator->first) + ".bin");
string output_filepath = join_file_paths(state.marker_pack_root_directory, to_string(iterator->first) + ".guildpoint");

_write_protobuf_file(
output_filepath,
Expand Down
1 change: 0 additions & 1 deletion xml_converter/src/packaging_protobin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ std::set<std::string> read_protobuf_file(

void write_protobuf_file(
const std::string& marker_pack_root_directory,
const StringHierarchy& category_filter,
const std::map<std::string, Category>* marker_categories,
const std::vector<Parseable*>* parsed_pois);

Expand Down
4 changes: 1 addition & 3 deletions xml_converter/src/xml_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ void write_burrito_directory(
return;
}
}
StringHierarchy category_filter;
category_filter.add_path({}, true);
write_protobuf_file(output_path, category_filter, marker_categories, parsed_pois);
write_protobuf_file(output_path, marker_categories, parsed_pois);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit ab61a52

Please sign in to comment.