Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Updated UUID support.
[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 #else
15     
16 #include <stdio.h>
17     
18     wxString Result;
19     
20     FILE *uuid_hdl = popen("uuidgen", "r");
21     
22     if (uuid_hdl == NULL) {
23         return Result;
24     }
25     
26     char strdata[64];
27     std::string uuidout;
28     
29     size_t readsize;
30     int size = 0;
31     int maxsize = 63;
32     
33     while (fgets(strdata, sizeof(strdata), uuid_hdl) != NULL){
34         uuidout.append(strdata);
35     }
36     
37     pclose(uuid_hdl);
38     
39     Result = wxString::Format(wxT("%s"), uuidout);
40     Result.Trim();
41     
42 #endif
43     
44     return Result;
45         
46 }
48 bool CheckUUID(wxString UUIDInc)
49 {
50     
51     bool Result = FALSE;
52     
53     return Result;
54     
55 }
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