1 #ifndef _GENERAL_H 2 #define _GENERAL_H 3 4 #include <string> 5 6 extern uint32 MDFN_RoundUpPow2(uint32); 7 8 void GetFileBase(const char *f); 9 10 // File-inclusion for-read-only path, for PSF and CUE/TOC sheet usage. 11 bool MDFN_IsFIROPSafe(const std::string &path); 12 13 std::string MDFN_MakeFName(int type, int id1, const char *cd1); 14 15 void MDFN_ltrim(char *string); 16 void MDFN_rtrim(char *string); 17 void MDFN_trim(char *string); 18 19 void MDFN_ltrim(std::string &string); 20 void MDFN_rtrim(std::string &string); 21 void MDFN_trim(std::string &string); 22 23 typedef enum 24 { 25 MDFNMKF_STATE = 0, 26 MDFNMKF_SNAP, 27 MDFNMKF_SAV, 28 MDFNMKF_CHEAT, 29 MDFNMKF_PALETTE, 30 MDFNMKF_IPS, 31 MDFNMKF_MOVIE, 32 MDFNMKF_AUX, 33 MDFNMKF_SNAP_DAT, 34 MDFNMKF_CHEAT_TMP, 35 MDFNMKF_FIRMWARE 36 } MakeFName_Type; 37 38 std::string MDFN_MakeFName(MakeFName_Type type, int id1, const char *cd1); 39 40 void MDFN_GetFilePathComponents(const std::string &file_path, std::string *dir_path_out, std::string *file_base_out = NULL, std::string *file_ext_out = NULL); 41 std::string MDFN_EvalFIP(const std::string &dir_path, const std::string &rel_path, bool skip_safety_check = false); 42 #endif 43