1
0

nsguid.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _NSGUID_H
  2. #define _NSGUID_H
  3. #include "../../replicant/foundation/guid.h"
  4. #include <bfc/platform/guid.h>
  5. //#include <bfc/common.h>
  6. // Some conversion functions to allow
  7. // us to have GUIDs translatable to and from other data types.
  8. class nsGUID {
  9. public:
  10. // To the "Human Readable" character format.
  11. // {1B3CA60C-DA98-4826-B4A9-D79748A5FD73}
  12. static char *toChar(const GUID &guid, char *target);
  13. static wchar_t *toCharW(const GUID &guid, wchar_t *target);
  14. static GUID fromCharW(const wchar_t *source);
  15. // To the "C Structure" character format.
  16. // { 0x1b3ca60c, 0xda98, 0x4826, { 0xb4, 0xa9, 0xd7, 0x97, 0x48, 0xa5, 0xfd, 0x73 } };
  17. static char *toCode(const GUID &guid, char *target);
  18. static GUID fromCode(const char *source);
  19. // Compare function, returns -1, 0, 1
  20. static int compare(const GUID &a, const GUID &b);
  21. // strlen("{xx xxx xxx-xxxx-xxxx-xxxx-xxx xxx xxx xxx}"
  22. enum { GUID_STRLEN = 38 };
  23. #ifdef WASABI_COMPILE_CREATEGUID
  24. static void createGuid(GUID *g);
  25. #endif
  26. };
  27. #endif //_NSGUID_H