Skip to content

Commit

Permalink
Error messages update (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDMC authored Oct 29, 2023
1 parent 91cdc4f commit 1ff1b4b
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 115 deletions.
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

0 comments on commit 1ff1b4b

Please sign in to comment.