diff options
Diffstat (limited to 'enum2string.cpp')
| -rw-r--r-- | enum2string.cpp | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/enum2string.cpp b/enum2string.cpp new file mode 100644 index 0000000..870aeba --- /dev/null +++ b/enum2string.cpp | |||
| @@ -0,0 +1,163 @@ | |||
| 1 | /* | ||
| 2 | This file is a part of "Didrole's Update Tool" | ||
| 3 | ©2k12, Didrole | ||
| 4 | |||
| 5 | License : Public domain | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include "../../Open Steamworks/Steamworks.h" | ||
| 9 | |||
| 10 | const char* AppState2String(EAppState eState) | ||
| 11 | { | ||
| 12 | if(eState & k_EAppStateReconfiguring) | ||
| 13 | return "Reconfiguring"; | ||
| 14 | if(eState & k_EAppStatePreallocating) | ||
| 15 | return "Preallocating"; | ||
| 16 | if(eState & k_EAppStateDownloading) | ||
| 17 | return "Downloading"; | ||
| 18 | if(eState & k_EAppStateStaging) | ||
| 19 | return "Staging"; | ||
| 20 | if(eState & k_EAppStateCommitting) | ||
| 21 | return "Committing"; | ||
| 22 | if(eState & k_EAppStateValidating) | ||
| 23 | return "Validating"; | ||
| 24 | if(eState & k_EAppStateFullyInstalled) | ||
| 25 | return "Installed"; | ||
| 26 | if (eState & k_EAppStateUpdateRequired) | ||
| 27 | return "Update required"; | ||
| 28 | if (eState & k_EAppStateUninstalled) | ||
| 29 | return "Not installed"; | ||
| 30 | |||
| 31 | return "Unknown state"; | ||
| 32 | } | ||
| 33 | |||
| 34 | const char* EResult2String(EResult eResult) | ||
| 35 | { | ||
| 36 | static const char* s_szStrings[] = | ||
| 37 | { | ||
| 38 | "Invalid EResult", | ||
| 39 | "OK", | ||
| 40 | "Failure", | ||
| 41 | "No Connection", | ||
| 42 | "Invalid EResult", | ||
| 43 | "Invalid Password", | ||
| 44 | "Logged In Elsewhere", | ||
| 45 | "Invalid Protocol", | ||
| 46 | "Invalid Parameter", | ||
| 47 | "File Not Found", | ||
| 48 | "Busy", | ||
| 49 | "Invalid State", | ||
| 50 | "Invalid Name", | ||
| 51 | "Invalid Email", | ||
| 52 | "Duplicate Name", | ||
| 53 | "Access Denied", | ||
| 54 | "Timeout", | ||
| 55 | "Banned", | ||
| 56 | "Account Not Found", | ||
| 57 | "Invalid Steam ID", | ||
| 58 | "Service Unavailable", | ||
| 59 | "Not Logged On", | ||
| 60 | "Pending", | ||
| 61 | "Encryption Failure", | ||
| 62 | "Insufficient Privilege", | ||
| 63 | "Limit exceeded", | ||
| 64 | "Request revoked", | ||
| 65 | "License expired", | ||
| 66 | "Already Redeemed", | ||
| 67 | "Duplicated Request", | ||
| 68 | "Already Owned", | ||
| 69 | "IP Address Not Found", | ||
| 70 | "Persistence Failed", | ||
| 71 | "Locking Failed", | ||
| 72 | "Session Replaced", | ||
| 73 | "Connection Failed", | ||
| 74 | "Handshake Failed", | ||
| 75 | "I/O Operation Failed", | ||
| 76 | "Disconnected By Remote Host", | ||
| 77 | "Shopping Cart Not Found", | ||
| 78 | "Blocked", | ||
| 79 | "Ignored", | ||
| 80 | "No match", | ||
| 81 | "Account Disabled", | ||
| 82 | "Service Read only", | ||
| 83 | "Account Not Featured", | ||
| 84 | "Administrator OK", | ||
| 85 | "Content version mismatch", | ||
| 86 | "Try another CM", | ||
| 87 | "Password required to kick session", | ||
| 88 | "Already Logged In Elsewhere", | ||
| 89 | "Request suspended/paused", | ||
| 90 | "Request has been canceled", | ||
| 91 | "Corrupted or unrecoverable data error", | ||
| 92 | "Not enough free disk space", | ||
| 93 | "Remote call failed", | ||
| 94 | "Password is not set", | ||
| 95 | "External Account is not linked to a Steam account", | ||
| 96 | "PSN Ticket is invalid", | ||
| 97 | "External Account linked to another Steam account", | ||
| 98 | "Remote File Conflict", | ||
| 99 | "Illegal password", | ||
| 100 | "Same as previous value", | ||
| 101 | "Account Logon Denied", | ||
| 102 | "Cannot Use Old Password", | ||
| 103 | "Invalid Login Auth Code", | ||
| 104 | "Account Logon Denied no mail sent", | ||
| 105 | "Hardware not capable of IPT", | ||
| 106 | "IPT init error", | ||
| 107 | "Operation failed due to parental control restrictions for current user", | ||
| 108 | "Facebook query returned an error", | ||
| 109 | "Expired Login Auth Code", | ||
| 110 | "IP Login Restriction Failed", | ||
| 111 | "Account Locked Down", | ||
| 112 | "Account Logon Denied Verified Email Required", | ||
| 113 | "No matching URL", | ||
| 114 | "Bad response", | ||
| 115 | }; | ||
| 116 | |||
| 117 | if(eResult >= k_EResultOK && eResult <= k_EResultBadResponse) | ||
| 118 | return s_szStrings[eResult]; | ||
| 119 | else | ||
| 120 | return s_szStrings[0]; | ||
| 121 | } | ||
| 122 | |||
| 123 | const char* EAppUpdateError2String(EAppUpdateError eError) | ||
| 124 | { | ||
| 125 | static const char* s_szStrings[] = | ||
| 126 | { | ||
| 127 | "No Error", | ||
| 128 | "Unspecified Error", | ||
| 129 | "Paused", | ||
| 130 | "Canceled", | ||
| 131 | "Suspended", | ||
| 132 | "No subscription", | ||
| 133 | "No connection", | ||
| 134 | "Connection timeout", | ||
| 135 | "Missing decryption key", | ||
| 136 | "Missing configuration", | ||
| 137 | "Missing content", | ||
| 138 | "Disk IO failure", | ||
| 139 | "Not enough disk space", | ||
| 140 | "Corrupt game files", | ||
| 141 | "Waiting for disk", | ||
| 142 | "Invalid install path", | ||
| 143 | "Application running", | ||
| 144 | "Dependency failure", | ||
| 145 | "Not installed", | ||
| 146 | "Update required", | ||
| 147 | "Still busy", | ||
| 148 | "No connection to content servers", | ||
| 149 | "Invalid application configuration", | ||
| 150 | "Invalid content configuration", | ||
| 151 | "Missing manifest", | ||
| 152 | "Not released", | ||
| 153 | "Region restricted", | ||
| 154 | "Corrupt depot cache", | ||
| 155 | "Missing executable", | ||
| 156 | "Invalid platform", | ||
| 157 | }; | ||
| 158 | |||
| 159 | if(eError >= k_EAppErrorNone && eError <= k_EAppErrorInvalidPlatform) | ||
| 160 | return s_szStrings[eError]; | ||
| 161 | else | ||
| 162 | return "Invalid EAppUpdateError"; | ||
| 163 | } | ||
