/wxfilename.mod/glue.h

https://github.com/BlitzMaxModules/wx.mod · C Header · 129 lines · 94 code · 13 blank · 22 comment · 0 complexity · fe2cb591916b3d6d7a7ce7251dd6d3dc MD5 · raw file

  1. /*
  2. Copyright (c) 2007-2013 Bruce A Henderson
  3. Permission is hereby granted, free of charge, to any person obtaining a copy
  4. of this software and associated documentation files (the "Software"), to deal
  5. in the Software without restriction, including without limitation the rights
  6. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. copies of the Software, and to permit persons to whom the Software is
  8. furnished to do so, subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in
  10. all copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17. THE SOFTWARE.
  18. */
  19. #ifndef _WX_MAX_FILENAME_H_
  20. #define _WX_MAX_FILENAME_H_
  21. #include "wxglue.h"
  22. #include "wx/filename.h"
  23. class MaxFileName;
  24. extern "C" {
  25. #include <blitz.h>
  26. MaxFileName * bmx_wxfilename_create(BBString * path, BBString * name, wxPathFormat format);
  27. void bmx_wxfilename_appenddir(MaxFileName * fname, BBString * dir);
  28. void bmx_wxfilename_assigncwd(MaxFileName * fname, BBString * volume);
  29. void bmx_wxfilename_assigndir(MaxFileName * fname, BBString * dir, wxPathFormat format);
  30. void bmx_wxfilename_assignhomedir(MaxFileName * fname);
  31. void bmx_wxfilename_clear(MaxFileName * fname);
  32. void bmx_wxfilename_clearext(MaxFileName * fname);
  33. int bmx_wxfilename_direxists(BBString * dir);
  34. MaxFileName * bmx_wxfilename_dirname(BBString * dir, wxPathFormat format);
  35. int bmx_wxfilename_fileexists(MaxFileName * fname);
  36. int bmx_wxfilename_ffileexists(BBString * filename);
  37. MaxFileName * bmx_wxfilename_filename(BBString * file, wxPathFormat format);
  38. BBString * bmx_wxfilename_getcwd(BBString * volume);
  39. int bmx_wxfilename_getdircount(MaxFileName * fname);
  40. BBArray * bmx_wxfilename_getdirs(MaxFileName * fname);
  41. BBString * bmx_wxfilename_getext(MaxFileName * fname);
  42. BBString * bmx_wxfilename_getforbiddenchars(wxPathFormat format);
  43. wxPathFormat bmx_wxfilename_getformat(wxPathFormat format);
  44. BBString * bmx_wxfilename_getfullname(MaxFileName * fname);
  45. BBString * bmx_wxfilename_getfullpath(MaxFileName * fname, wxPathFormat format);
  46. BBString * bmx_wxfilename_gethomedir();
  47. BBString * bmx_wxfilename_getlongpath(MaxFileName * fname);
  48. time_t bmx_wxfilename_getmodificationtime(MaxFileName * fname);
  49. BBString * bmx_wxfilename_getname(MaxFileName * fname);
  50. BBString * bmx_wxfilename_getpath(MaxFileName * fname, int flags, wxPathFormat format);
  51. BBString * bmx_wxfilename_getpathseparator(wxPathFormat format);
  52. BBString * bmx_wxfilename_getpathseparators(wxPathFormat format);
  53. BBString * bmx_wxfilename_getpathterminators(wxPathFormat format);
  54. BBString * bmx_wxfilename_getpathwithsep(MaxFileName * fname, wxPathFormat format);
  55. BBString * bmx_wxfilename_getshortpath(MaxFileName * fname);
  56. void bmx_wxfilename_getsize(MaxFileName * fname, BBInt64 * size);
  57. void bmx_wxfilename_fgetsize(BBString * filename, BBInt64 * size);
  58. BBString * bmx_wxfilename_gethumanreadablesize(MaxFileName * fname, BBString * failmsg, int precision);
  59. BBString * bmx_wxfilename_fgethumanreadablesize(BBInt64 size, BBString * failmsg, int precision);
  60. BBString * bmx_wxfilename_gettempdir();
  61. BBString * bmx_wxfilename_getvolume(MaxFileName * fname);
  62. BBString * bmx_wxfilename_getvolumeseparator(wxPathFormat format);
  63. int bmx_wxfilename_hasext(MaxFileName * fname);
  64. int bmx_wxfilename_hasname(MaxFileName * fname);
  65. int bmx_wxfilename_hasvolume(MaxFileName * fname);
  66. void bmx_wxfilename_insertdir(MaxFileName * fname, int before, BBString * dir);
  67. int bmx_wxfilename_isabsolute(MaxFileName * fname, wxPathFormat format);
  68. int bmx_wxfilename_iscasesensitive(wxPathFormat format);
  69. int bmx_wxfilename_isdirreadable(MaxFileName * fname);
  70. int bmx_wxfilename_fisdirreadable(BBString * dir);
  71. int bmx_wxfilename_isdirwritable(MaxFileName * fname);
  72. int bmx_wxfilename_fisdirwritable(BBString * dir);
  73. int bmx_wxfilename_isfileexecutable(MaxFileName * fname);
  74. int bmx_wxfilename_fisfileexecutable(BBString * file);
  75. int bmx_wxfilename_isfilereadable(MaxFileName * fname);
  76. int bmx_wxfilename_fisfilereadable(BBString * file);
  77. int bmx_wxfilename_isfilewritable(MaxFileName * fname);
  78. int bmx_wxfilename_fisfilewritable(BBString * file);
  79. int bmx_wxfilename_isok(MaxFileName * fname);
  80. int bmx_wxfilename_ispathseparator(BBString * chr, wxPathFormat format);
  81. int bmx_wxfilename_isrelative(MaxFileName * fname, wxPathFormat format);
  82. int bmx_wxfilename_isdir(MaxFileName * fname);
  83. int bmx_wxfilename_makeabsolute(MaxFileName * fname, BBString * cwd, wxPathFormat format);
  84. int bmx_wxfilename_makerelativeto(MaxFileName * fname, BBString * pathBase, wxPathFormat format);
  85. int bmx_wxfilename_mkdir(MaxFileName * fname, int perm, int flags);
  86. int bmx_wxfilename_fmkdir(BBString * dir, int perm, int flags);
  87. int bmx_wxfilename_normalize(MaxFileName * fname, int flags, BBString * cwd, wxPathFormat format);
  88. void bmx_wxfilename_prependdir(MaxFileName * fname, BBString * dir);
  89. void bmx_wxfilename_removedir(MaxFileName * fname, int pos);
  90. void bmx_wxfilename_removelastdir(MaxFileName * fname);
  91. int bmx_wxfilename_rmdir(MaxFileName * fname);
  92. int bmx_wxfilename_frmdir(BBString * dir);
  93. int bmx_wxfilename_sameas(MaxFileName * fname, MaxFileName * filename, wxPathFormat format);
  94. int bmx_wxfilename_setcwd(MaxFileName * fname);
  95. int bmx_wxfilename_fsetcwd(BBString * dir);
  96. void bmx_wxfilename_setext(MaxFileName * fname, BBString * ext);
  97. void bmx_wxfilename_setemptyext(MaxFileName * fname);
  98. void bmx_wxfilename_setfullname(MaxFileName * fname, BBString * name);
  99. void bmx_wxfilename_setname(MaxFileName * fname, BBString * name);
  100. void bmx_wxfilename_setvolume(MaxFileName * fname, BBString * volume);
  101. int bmx_wxfilename_touch(MaxFileName * fname);
  102. void bmx_wxfilename_delete(MaxFileName * fname);
  103. }
  104. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  105. class MaxFileName
  106. {
  107. public:
  108. MaxFileName(const wxFileName & b);
  109. wxFileName & Filename();
  110. private:
  111. wxFileName filename;
  112. };
  113. #endif // _WX_MAX_FILENAME_H_