Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Adjusted UUID generation so it fetches from an application called uuidgen on non...
[xestiaab/.git] / source / common / uuid.cpp
1 #include <wx/wx.h>
3 wxString GenerateUUID()
4 {
6 #if defined(__WIN32__)
7     UUID UUIDData;
8     UuidCreate(&UUIDData);
9     wchar_t* UUIDStr = 0;
10     UuidToString(&UUIDData, (RPC_WSTR*)&UUIDStr);
11     wxString Result(UUIDStr);
12 #elif defined(__HAIKU__)
13     
14 #elif defined(__APPLE__)
15     
16     wxString Result;
17     
18 #else
19     
20 #include <stdio.h>
21     
22     wxString Result;
23     
24     FILE *uuid_hdl = popen("uuidgen", "r");
25     
26     if (uuid_hdl == NULL) {
27         return Result;
28     }
29     
30     char strdata[64];
31     std::string uuidout;
32     
33     size_t readsize;
34     int size = 0;
35     int maxsize = 63;
36     
37     while (fgets(strdata, sizeof(strdata), uuid_hdl) != NULL){
38         uuidout.append(strdata);
39     }
40     
41     pclose(uuid_hdl);
42     
43 /*#include <uuid/uuid.h>
44     
45     uuid_t *uuid;
46     uuid_create(&uuid);
47     char *strdata[100];
48     
49     strdata = NULL;
50     
51     wxString Result = wxString::FromUTF8(strdata);
52     
53     delete strdata;
54     strdata = NULL;*/
55     
56 #endif
57     
58     return Result;
59         
60 }
62 bool CheckUUID(wxString UUIDInc)
63 {
64     
65     bool Result = FALSE;
66     
67     return Result;
68     
69 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy