Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages update #13

Merged
merged 10 commits into from
Oct 29, 2023
65 changes: 65 additions & 0 deletions cleo_sdk/CLEO.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,71 @@ enum eDataType : int
DT_VAR_STRING_ARRAY,
DT_LVAR_STRING_ARRAY
};
static const char* ToStr(eDataType type)
{
switch (type)
{
case DT_END: return "VArgEnd"; break;
case DT_DWORD: return "Int32"; break;
case DT_VAR: return "GlobVar"; break;
case DT_LVAR: return "LocVar"; break;
case DT_BYTE: return "Int8"; break;
case DT_WORD: return "Int16"; break;
case DT_FLOAT: return "Float32"; break;
case DT_VAR_ARRAY: return "GlobVarArr"; break;
case DT_LVAR_ARRAY: return "LocVarArr"; break;
case DT_TEXTLABEL: return "STxt"; break;
case DT_VAR_TEXTLABEL: return "GlobVarSTxt"; break;
case DT_LVAR_TEXTLABEL: return "LocVarSTxt"; break;
case DT_VAR_TEXTLABEL_ARRAY: return "GlobVarSTxtArr"; break;
case DT_LVAR_TEXTLABEL_ARRAY: return "LocVarSTxtArr"; break;
case DT_VARLEN_STRING: return "Txt"; break;
case DT_STRING: return "LTxt"; break;
case DT_VAR_STRING: return "GlobVarLTxt"; break;
case DT_LVAR_STRING: return "LocVarLTxt"; break;
case DT_VAR_STRING_ARRAY: return "GlobVarLTxtArr"; break;
case DT_LVAR_STRING_ARRAY: return "LocVarLTxtArr"; break;
default: return "corrupted";
}
}
static const char* ToKindStr(eDataType type)
{
switch (type)
{
case DT_BYTE:
case DT_WORD:
case DT_DWORD:
return "int"; break;

case DT_FLOAT:
return "float"; break;

case DT_STRING:
case DT_TEXTLABEL:
case DT_LVAR_TEXTLABEL:
case DT_LVAR_TEXTLABEL_ARRAY:
case DT_LVAR_STRING:
case DT_LVAR_STRING_ARRAY:
case DT_VAR_TEXTLABEL:
case DT_VAR_TEXTLABEL_ARRAY:
case DT_VAR_STRING:
case DT_VAR_STRING_ARRAY:
case DT_VARLEN_STRING:
return "string"; break;

case DT_VAR:
case DT_VAR_ARRAY:
case DT_LVAR:
case DT_LVAR_ARRAY:
return "variable"; break;

case DT_END:
return "varArgEnd"; break;

default:
return "corrupted"; break;
}
}

const size_t MAX_STR_LEN = 0xff; // max length of string type parameter

Expand Down
Loading
Loading