|
| 1 | +#define __FILE_TAG_DEBUG_UNTRACKED_JUL_11_2011__ "C:\\SD\\Reach\\Publishing\\Main\\shared\\engine\\source\\omaha\\tag_files\\tag_files.cpp" |
1 | 2 | /* ---------- headers */ |
2 | 3 |
|
3 | 4 | #include "omaha\tag_files\tag_files.h" |
| 5 | +#include "omaha\tag_files\tag_group_files.h" |
| 6 | +#include "core\corelib\cseries\cseries_asserts.h" |
| 7 | +#include "core\corelib\cseries\cseries_string.h" |
4 | 8 |
|
5 | 9 | /* ---------- constants */ |
6 | 10 |
|
|
12 | 16 |
|
13 | 17 | /* ---------- public code */ |
14 | 18 |
|
15 | | -/* ---------- private code */ |
16 | | - |
17 | | -/* ---------- reverse engineering */ |
18 | | - |
19 | | -// public: static enum e_load_tag_flag const c_flags_no_init<enum e_load_tag_flag, unsigned short, 10, struct s_default_enum_string_resolver>::k_maximum_count; // "?k_maximum_count@?$c_flags_no_init@W4e_load_tag_flag@@G$09Us_default_enum_string_resolver@@@@2W4e_load_tag_flag@@B" |
20 | | -// struct s_tag_file_shim_backend const *const g_default_tag_file_shim; // "?g_default_tag_file_shim@@3PBUs_tag_file_shim_backend@@B" |
21 | | - |
22 | | -// void tag_files_open(enum e_shell_application_type); |
23 | | -// void tag_files_close(void); |
24 | | -// void tag_files_initialize_from_main(void); |
25 | | -// void tag_files_dispose_backend(void); |
26 | | -// void tag_files_set_initialized_backend(struct s_tag_file_shim_backend const *); |
27 | | -// void tag_files_set_backend(struct s_tag_file_shim_backend const *); |
28 | | -// void tag_file_set_backend_by_name(char const *); |
29 | | -// long tag_files_get_sequence_identifier(void); |
30 | | -// bool tag_files_backend_supports_alternate_streams(void); |
31 | | -// bool tag_files_can_load_tags(void); |
32 | | -// bool tag_files_get_total_bytes_read(unsigned __int64*); |
33 | | -// void tag_files_dump_allocation_profile(void); |
34 | | -// bool tag_file_try_to_read(unsigned long, char const *, unsigned long, unsigned long, void *); |
35 | | -// void tag_files_pin_layout_cache(void); |
36 | | -// void tag_files_unpin_layout_cache(void); |
37 | | -// bool tag_files_support_async_data(void); |
38 | | -// bool tag_files_async_data_available(void); |
39 | | -// struct s_async_task_id tag_file_read_async(long, unsigned long, char const *, unsigned long, unsigned long, void *, class c_synchronized_int32*, class c_synchronized_int32*, long, long); |
40 | | -// bool tag_file_has_async_data(unsigned long, char const *); |
41 | | -// bool tag_file_read_only(unsigned long, char const *); |
42 | | -// bool tag_file_get_last_modification_date(unsigned long, char const *, struct s_file_last_modification_date *); |
43 | | -// bool tag_file_set_writeable(unsigned long, char const *, bool); |
44 | | -// bool tag_file_checksum(unsigned long, char const *, unsigned long *); |
45 | | -// bool tag_file_exists(unsigned long, char const *); |
46 | | -// bool tag_file_get_file_reference(struct s_file_reference *, unsigned long, char const *); |
47 | | -// bool tag_file_get_name_and_group_tag_from_path(char const *, unsigned long *, char (&)[256]); |
48 | | -// char const * tag_files_get_root_directory_path(void); |
49 | | -// void tag_files_predict_load(class c_tag_files_prediction_manager *, unsigned long, char const *); |
50 | | -// void tag_files_predict_load_from_block(class c_tag_files_prediction_manager *, struct s_tag_block const *); |
51 | | -// void tag_files_predict_load_finished(void); |
52 | | -// bool tag_save_to_backend(struct s_tag_group const *, char const *, struct s_tag_block *, unsigned long *, class c_tag_alternate_stream_iterator *); |
53 | | -// bool tag_load_from_backend(struct s_tag_block *, struct s_tag_group const *, char const *, class c_flags<enum e_load_tag_flag, unsigned short, 10, struct s_default_enum_string_resolver>, enum e_tag_file_open_result *, bool *, unsigned long *, class c_tag_alternate_stream_consumer *); |
54 | | -// void tag_files_sync_initialize(void); |
55 | | -// void tag_files_sync_dispose(void); |
56 | | -// void tag_files_sync_idle(void); |
57 | | -// bool tag_files_sync_tags_changed(void); |
58 | | -// class c_tag_file_difference_iterator * tag_files_sync_get_difference_iterator(void); |
59 | | -// void tag_files_sync_dispose_difference_iterator(class c_tag_file_difference_iterator *); |
60 | | -// void tag_files_sync_reload_begin(void); |
61 | | -// void tag_files_sync_reload_end(void); |
62 | | -// void tag_files_set_cache_file_output(class c_allocation_interface *, class c_cache_file_builder_tag_resource_output *); |
63 | | -// void tag_files_close_cache_file_output(void); |
64 | | -// void tag_file_get_path(unsigned long, char const *, char (&)[256]); |
65 | | -// bool tag_file_create_temporary_path(unsigned long, char const *, char (&)[256], char (&)[256]); |
66 | | -// char * file_reference_get_name<256>(struct s_file_reference const *, unsigned long, char (&)[256]); |
67 | | -// char * file_reference_get_fullpath<256>(struct s_file_reference const *, char (&)[256]); |
68 | | - |
69 | 19 | //void tag_files_open(enum e_shell_application_type) |
70 | 20 | //{ |
71 | 21 | // mangled_ppc("?tag_files_open@@YAXW4e_shell_application_type@@@Z"); |
|
96 | 46 | // mangled_ppc("?tag_files_set_backend@@YAXPBUs_tag_file_shim_backend@@@Z"); |
97 | 47 | //}; |
98 | 48 |
|
99 | | -//void tag_file_set_backend_by_name(char const *) |
100 | | -//{ |
101 | | -// mangled_ppc("?tag_file_set_backend_by_name@@YAXPBD@Z"); |
102 | | -//}; |
| 49 | +void tag_file_set_backend_by_name(char const * new_backend_name) |
| 50 | +{ |
| 51 | + mangled_ppc("?tag_file_set_backend_by_name@@YAXPBD@Z"); |
| 52 | + |
| 53 | + assert_tag_debug_untracked_jul_11_2011(162, new_backend_name); |
| 54 | + |
| 55 | + if(ascii_stricmp(new_backend_name, "default") == 0) |
| 56 | + { |
| 57 | + tag_files_set_backend(g_default_tag_file_shim); |
| 58 | + } |
| 59 | + else if(ascii_stricmp(new_backend_name, "single_new") == 0) |
| 60 | + { |
| 61 | + tag_files_set_backend(&g_single_file_tag_file_backend); |
| 62 | + } |
| 63 | + else if(ascii_stricmp(new_backend_name, "monolithic_new") == 0) |
| 64 | + { |
| 65 | + tag_files_set_backend(&g_monolithic_tag_file_backend); |
| 66 | + } |
| 67 | + else if(ascii_stricmp(new_backend_name, "monolithic_new_xbox") == 0) |
| 68 | + { |
| 69 | + tag_files_set_backend(&g_xbox_monolithic_tag_file_backend); |
| 70 | + } |
| 71 | + else if(ascii_stricmp(new_backend_name, "simple_patched") == 0) |
| 72 | + { |
| 73 | + tag_files_set_backend(&g_simple_patched_tag_file_backend); |
| 74 | + } |
| 75 | + else if(ascii_stricmp(new_backend_name, "shared_cache_builder") == 0) |
| 76 | + { |
| 77 | + tag_files_set_backend(&g_cache_file_shared_tag_file_backend); |
| 78 | + } |
| 79 | + else if(ascii_stricmp(new_backend_name, "campaign_cache_builder") == 0) |
| 80 | + { |
| 81 | + tag_files_set_backend(&g_cache_file_campaign_tag_file_backend); |
| 82 | + } |
| 83 | +}; |
103 | 84 |
|
104 | 85 | //long tag_files_get_sequence_identifier(void) |
105 | 86 | //{ |
|
296 | 277 | // mangled_ppc("??$file_reference_get_fullpath@$0BAA@@@YAPADPBUs_file_reference@@AAY0BAA@D@Z"); |
297 | 278 | //}; |
298 | 279 |
|
| 280 | +/* ---------- private code */ |
| 281 | + |
| 282 | +/* ---------- reverse engineering */ |
| 283 | + |
| 284 | +// public: static enum e_load_tag_flag const c_flags_no_init<enum e_load_tag_flag, unsigned short, 10, struct s_default_enum_string_resolver>::k_maximum_count; // "?k_maximum_count@?$c_flags_no_init@W4e_load_tag_flag@@G$09Us_default_enum_string_resolver@@@@2W4e_load_tag_flag@@B" |
| 285 | +// struct s_tag_file_shim_backend const *const g_default_tag_file_shim; // "?g_default_tag_file_shim@@3PBUs_tag_file_shim_backend@@B" |
| 286 | + |
| 287 | +// void tag_files_open(enum e_shell_application_type); |
| 288 | +// void tag_files_close(void); |
| 289 | +// void tag_files_initialize_from_main(void); |
| 290 | +// void tag_files_dispose_backend(void); |
| 291 | +// void tag_files_set_initialized_backend(struct s_tag_file_shim_backend const *); |
| 292 | +// void tag_files_set_backend(struct s_tag_file_shim_backend const *); |
| 293 | +// void tag_file_set_backend_by_name(char const *); |
| 294 | +// long tag_files_get_sequence_identifier(void); |
| 295 | +// bool tag_files_backend_supports_alternate_streams(void); |
| 296 | +// bool tag_files_can_load_tags(void); |
| 297 | +// bool tag_files_get_total_bytes_read(unsigned __int64*); |
| 298 | +// void tag_files_dump_allocation_profile(void); |
| 299 | +// bool tag_file_try_to_read(unsigned long, char const *, unsigned long, unsigned long, void *); |
| 300 | +// void tag_files_pin_layout_cache(void); |
| 301 | +// void tag_files_unpin_layout_cache(void); |
| 302 | +// bool tag_files_support_async_data(void); |
| 303 | +// bool tag_files_async_data_available(void); |
| 304 | +// struct s_async_task_id tag_file_read_async(long, unsigned long, char const *, unsigned long, unsigned long, void *, class c_synchronized_int32*, class c_synchronized_int32*, long, long); |
| 305 | +// bool tag_file_has_async_data(unsigned long, char const *); |
| 306 | +// bool tag_file_read_only(unsigned long, char const *); |
| 307 | +// bool tag_file_get_last_modification_date(unsigned long, char const *, struct s_file_last_modification_date *); |
| 308 | +// bool tag_file_set_writeable(unsigned long, char const *, bool); |
| 309 | +// bool tag_file_checksum(unsigned long, char const *, unsigned long *); |
| 310 | +// bool tag_file_exists(unsigned long, char const *); |
| 311 | +// bool tag_file_get_file_reference(struct s_file_reference *, unsigned long, char const *); |
| 312 | +// bool tag_file_get_name_and_group_tag_from_path(char const *, unsigned long *, char (&)[256]); |
| 313 | +// char const * tag_files_get_root_directory_path(void); |
| 314 | +// void tag_files_predict_load(class c_tag_files_prediction_manager *, unsigned long, char const *); |
| 315 | +// void tag_files_predict_load_from_block(class c_tag_files_prediction_manager *, struct s_tag_block const *); |
| 316 | +// void tag_files_predict_load_finished(void); |
| 317 | +// bool tag_save_to_backend(struct s_tag_group const *, char const *, struct s_tag_block *, unsigned long *, class c_tag_alternate_stream_iterator *); |
| 318 | +// bool tag_load_from_backend(struct s_tag_block *, struct s_tag_group const *, char const *, class c_flags<enum e_load_tag_flag, unsigned short, 10, struct s_default_enum_string_resolver>, enum e_tag_file_open_result *, bool *, unsigned long *, class c_tag_alternate_stream_consumer *); |
| 319 | +// void tag_files_sync_initialize(void); |
| 320 | +// void tag_files_sync_dispose(void); |
| 321 | +// void tag_files_sync_idle(void); |
| 322 | +// bool tag_files_sync_tags_changed(void); |
| 323 | +// class c_tag_file_difference_iterator * tag_files_sync_get_difference_iterator(void); |
| 324 | +// void tag_files_sync_dispose_difference_iterator(class c_tag_file_difference_iterator *); |
| 325 | +// void tag_files_sync_reload_begin(void); |
| 326 | +// void tag_files_sync_reload_end(void); |
| 327 | +// void tag_files_set_cache_file_output(class c_allocation_interface *, class c_cache_file_builder_tag_resource_output *); |
| 328 | +// void tag_files_close_cache_file_output(void); |
| 329 | +// void tag_file_get_path(unsigned long, char const *, char (&)[256]); |
| 330 | +// bool tag_file_create_temporary_path(unsigned long, char const *, char (&)[256], char (&)[256]); |
| 331 | +// char * file_reference_get_name<256>(struct s_file_reference const *, unsigned long, char (&)[256]); |
| 332 | +// char * file_reference_get_fullpath<256>(struct s_file_reference const *, char (&)[256]); |
0 commit comments