#include <iostream>
#include <string>
#include <iosfwd>
#include "common_types.h"
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
int | snprintf (char *, size_t, const char *,...) |
uint8 | Read1 (std::istream &in) |
uint16 | Read2 (std::istream &in) |
uint16 | Read2 (uint8 *&in) |
uint16 | Read2high (std::istream &in) |
uint16 | Read2high (uint8 *&in) |
uint32 | Read4 (std::istream &in) |
uint32 | Read4 (uint8 *&in) |
uint32 | Read4high (std::istream &in) |
uint32 | Read4high (uint8 *&in) |
void | Write1 (std::ostream &out, uint16 val) |
void | Write2 (std::ostream &out, uint16 val) |
void | Write2high (std::ostream &out, uint16 val) |
void | Write2 (uint8 *&out, uint16 val) |
void | Write4 (std::ostream &out, uint32 val) |
void | Write4high (std::ostream &out, uint32 val) |
void | Write4 (uint8 *&out, uint32 val) |
void | Write4s (std::ostream &out, sint32 val) |
bool | U7open (std::ifstream &in, const char *fname, bool is_text=false) |
bool | U7open (std::ofstream &out, const char *fname, bool is_text=false) |
void | U7remove (const char *fname) |
bool | U7exists (const char *fname) |
bool | U7exists (std::string fname) |
int | U7mkdir (const char *dirname, int mode) |
int | U7chdir (const char *dirname) |
void | U7copy (const char *src, const char *dest) |
bool | is_system_path_defined (const std::string &key) |
void | store_system_paths () |
void | reset_system_paths () |
void | clear_system_path (const std::string &key) |
void | add_system_path (const std::string &key, const std::string &value) |
void | clone_system_path (const std::string &new_key, const std::string &old_key) |
std::string | get_system_path (const std::string &path) |
void | to_uppercase (std::string &str) |
std::string | to_uppercase (const std::string &str) |
int | Log2 (uint32 n) |
char * | newstrdup (const char *s) |
void add_system_path | ( | const std::string & | key, | |
const std::string & | value | |||
) |
void clear_system_path | ( | const std::string & | key | ) |
void clone_system_path | ( | const std::string & | new_key, | |
const std::string & | old_key | |||
) |
std::string get_system_path | ( | const std::string & | path | ) |
bool is_system_path_defined | ( | const std::string & | key | ) |
int Log2 | ( | uint32 | n | ) |
char* newstrdup | ( | const char * | s | ) |
Definition at line 640 of file utils.cc.
Referenced by Game_window::get_game_identity(), Get_token(), Usecode_value::operator=(), Game_window::read_save_names(), Read_text_msg_file(), Game_window::save_gamedat(), ExultStudio::save_shape_window(), and Usecode_value::Usecode_value().
uint8 Read1 | ( | std::istream & | in | ) | [inline] |
Definition at line 42 of file utils.h.
Referenced by main(), StreamDataSource::read1(), Shapes_vga_file::read_info(), and readbin_U7UCFunc().
uint16 Read2 | ( | std::istream & | in | ) | [inline] |
Definition at line 51 of file utils.h.
Referenced by Chunk_chooser::delete_response(), Game_loc_response(), Chunk_chooser::get_chunk(), Get_u7_chunkid(), Get_u7_comboid(), Get_u7_shapeid(), Shape_frame::has_point(), Table::IndexTableFile(), Game_map::init(), ExultStudio::init_new_npc(), Chunk_chooser::insert_response(), Chunk_chooser::locate_response(), main(), Serial_in::operator<<(), Image_buffer8::paint_rle(), Shape_frame::paint_rle_outline(), Shape_frame::paint_rle_transformed(), Shape_frame::paint_rle_translucent(), Usecode_internal::read(), Keyring::read(), Armor_info::read(), Ammo_info::read(), Weapon_info::read(), StreamDataSource::read2(), Shapes_vga_file::read_info(), readbin_U7UCFunc(), Shape_frame::reflect(), Usecode_value::restore(), Usecode_script::restore(), Usecode_internal::run(), Chunk_chooser::set_chunk(), Shape_frame::set_offset(), Shape_group_file::Shape_group_file(), Stack_frame::Stack_frame(), Chunk_chooser::swap_response(), and Usecode_internal::uc_trace_disasm().
uint16 Read2high | ( | std::istream & | in | ) | [inline] |
uint32 Read4 | ( | std::istream & | in | ) | [inline] |
Definition at line 137 of file utils.h.
Referenced by Table::IndexTableFile(), main(), Serial_in::operator<<(), Usecode_internal::read(), StreamDataSource::read4(), Usecode_internal::read_usevars(), readbin_U7UCFunc(), Usecode_value::restore(), Usecode_script::restore(), Segment_file::retrieve(), Usecode_internal::run(), Segment_file::Segment_file(), Setup_item_names(), Stack_frame::Stack_frame(), Usecode_internal::uc_trace_disasm(), and Locator::view_changed().
uint32 Read4high | ( | std::istream & | in | ) | [inline] |
Definition at line 185 of file utils.h.
Referenced by IFF::IndexIFFFile(), main(), and StreamDataSource::read4high().
void reset_system_paths | ( | ) |
Definition at line 77 of file utils.cc.
References path_map, and stored_path_map.
Referenced by Init().
int snprintf | ( | char * | , | |
size_t | , | |||
const char * | , | |||
... | ||||
) |
void store_system_paths | ( | ) |
Definition at line 72 of file utils.cc.
References path_map, and stored_path_map.
Referenced by Init().
std::string to_uppercase | ( | const std::string & | str | ) |
Definition at line 216 of file utils.cc.
References s, and to_uppercase().
Here is the call graph for this function:
void to_uppercase | ( | std::string & | str | ) |
int U7chdir | ( | const char * | dirname | ) |
Definition at line 559 of file utils.cc.
References switch_slashes().
Here is the call graph for this function:
void U7copy | ( | const char * | src, | |
const char * | dest | |||
) |
Definition at line 578 of file utils.cc.
References U7open().
Referenced by ExultStudio::create_new_game().
Here is the call graph for this function:
bool U7exists | ( | std::string | fname | ) | [inline] |
Definition at line 362 of file utils.h.
References U7exists().
Here is the call graph for this function:
bool U7exists | ( | const char * | fname | ) |
Definition at line 490 of file utils.cc.
References base_to_uppercase(), get_system_path(), and stat().
Here is the call graph for this function:
int U7mkdir | ( | const char * | dirname, | |
int | mode | |||
) |
Definition at line 524 of file utils.cc.
References get_system_path().
Referenced by Game::create_game(), ExultStudio::create_new_game(), Shape_chooser::edit_shape(), get_game_paths(), Game_window::restore_gamedat(), ExultStudio::set_game_path(), and Game_map::write_static().
Here is the call graph for this function:
bool U7open | ( | std::ofstream & | out, | |
const char * | fname, | |||
bool | is_text = false | |||
) |
Definition at line 375 of file utils.cc.
References base_to_uppercase(), and get_system_path().
Here is the call graph for this function:
bool U7open | ( | std::ifstream & | in, | |
const char * | fname, | |||
bool | is_text = false | |||
) |
Definition at line 314 of file utils.cc.
References base_to_uppercase(), and get_system_path().
Here is the call graph for this function:
void U7remove | ( | const char * | fname | ) |
Definition at line 457 of file utils.cc.
References base_to_uppercase(), get_system_path(), Ucscript::remove, and stat().
Referenced by Newfile_gump::delete_file(), and Game_window::restore_gamedat().
Here is the call graph for this function:
void Write1 | ( | std::ostream & | out, | |
uint16 | val | |||
) | [inline] |
void Write2 | ( | std::ostream & | out, | |
uint16 | val | |||
) | [inline] |
Definition at line 244 of file utils.h.
Referenced by Shape_frame::encode_rle(), Uc_function::end_breakable(), Image_file_info::flush(), Uc_function::gen(), Uc_static_var_symbol::gen_assign(), Uc_var_symbol::gen_assign(), Uc_flag_expression::gen_assign(), Uc_arrayelem_expression::gen_assign(), Uc_function_symbol::gen_call(), Uc_intrinsic_symbol::gen_call(), Uc_response_expression::gen_jmp_if_false(), Uc_expression::gen_jmp_if_false(), Uc_string_symbol::gen_value(), Uc_const_int_symbol::gen_value(), Uc_static_var_symbol::gen_value(), Uc_var_symbol::gen_value(), Uc_array_expression::gen_value(), Uc_string_prefix_expression::gen_value(), Uc_string_expression::gen_value(), Uc_int_expression::gen_value(), Uc_flag_expression::gen_value(), Uc_arrayelem_expression::gen_value(), Chunk_chooser::get_chunk(), Chunk_chooser::insert(), Shape_chooser::locate(), Chunk_chooser::locate(), Chunk_chooser::locate_response(), Chunk_chooser::move(), Serial_out::operator<<(), Usecode_value::save(), Usecode_script::save(), ExultStudio::set_edit_lift(), ExultStudio::set_edit_mode(), ExultStudio::set_edit_terrain(), ExultStudio::set_hide_lift(), Shape_frame::set_offset(), ExultStudio::set_play(), ExultStudio::set_tile_grid(), Store_u7_chunkid(), Store_u7_comboid(), Store_u7_shapeid(), Chunk_chooser::tell_server(), Shape_chooser::tell_server_shape(), Usecode_internal::write(), Keyring::write(), Monster_info::write(), Armor_info::write(), Ammo_info::write(), Weapon_info::write(), Shape_group_file::write(), StreamDataSource::write2(), Shapes_vga_file::write_info(), Egg_object::write_ireg(), Container_game_object::write_ireg(), and Game_map::write_static().
void Write2high | ( | std::ostream & | out, | |
uint16 | val | |||
) | [inline] |
void Write4 | ( | std::ostream & | out, | |
uint32 | val | |||
) | [inline] |
Definition at line 286 of file utils.h.
Referenced by Flex_writer::mark_section_done(), Serial_out::operator<<(), Locator::query_location(), Usecode_value::save(), Usecode_script::save(), Locator::send_location(), Send_location(), LocationBreakpoint::serialize(), Usecode_internal::write(), Armor_info::write(), StreamDataSource::write4(), Write4s(), and Game_map::write_ifix_objects().
void Write4high | ( | std::ostream & | out, | |
uint32 | val | |||
) | [inline] |
void Write4s | ( | std::ostream & | out, | |
sint32 | val | |||
) | [inline] |