Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
c0e512ff11e88c86c7bd50541f6263f5b0976406
[xestiaab/.git] / source / common / uuid.cpp
1 #include <wx/wx.h>
3 wxString GenerateUUID()
4 {
6 #if defined(__WIN32__)
7 #include <rpc.h>
8     UUID UUIDData;
9     UuidCreate(&UUIDData);
10     wchar_t* UUIDStr = 0;
11     UuidToString(&UUIDData, (RPC_WSTR*)&UUIDStr);
12     wxString Result(UUIDStr);
13 #elif defined(__HAIKU__)
14     
15 #else
16     
17 #include <stdio.h>
18     
19     wxString Result;
20     
21     FILE *uuid_hdl = popen("uuidgen", "r");
22     
23     if (uuid_hdl == NULL) {
24         return Result;
25     }
26     
27     char strdata[64];
28     std::string uuidout;
29     
30     size_t readsize;
31     int size = 0;
32     int maxsize = 63;
33     
34     while (fgets(strdata, sizeof(strdata), uuid_hdl) != NULL){
35         uuidout.append(strdata);
36     }
37     
38     pclose(uuid_hdl);
39     
40     Result = wxString::Format(wxT("%s"), uuidout);
41     Result.Trim();
42     
43 #endif
44     
45     return Result;
46         
47 }
49 bool CheckUUID(wxString UUIDInc)
50 {
51     
52     bool Result = FALSE;
53     
54     return Result;
55     
56 }
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