MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / GetObjectIntProperty

Function GetObjectIntProperty

source/script2.cpp:8940–8965  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8938
8939
8940ResultType GetObjectIntProperty(IObject *aObject, LPTSTR aPropName, __int64 &aValue, ResultToken &aResultToken, bool aOptional)
8941{
8942 FuncResult result_token;
8943 ExprTokenType this_token = aObject;
8944
8945 auto result = aObject->Invoke(result_token, IT_GET, aPropName, this_token, nullptr, 0);
8946
8947 if (result_token.symbol != SYM_INTEGER)
8948 {
8949 result_token.Free();
8950 if (result == FAIL || result == EARLY_EXIT)
8951 {
8952 aResultToken.SetExitResult(result);
8953 return FAIL;
8954 }
8955 if (result != INVOKE_NOT_HANDLED) // Property exists but is not an integer.
8956 return aResultToken.Error(ERR_TYPE_MISMATCH, aPropName, ErrorPrototype::Type);
8957 //aValue = 0; // Caller should set default value for these cases.
8958 if (!aOptional)
8959 return aResultToken.UnknownMemberError(ExprTokenType(aObject), IT_GET, aPropName);
8960 return result; // Let caller know it wasn't found.
8961 }
8962
8963 aValue = result_token.value_int64;
8964 return OK;
8965}
8966
8967ResultType SetObjectIntProperty(IObject *aObject, LPTSTR aPropName, __int64 aValue, ResultToken &aResultToken)
8968{

Callers 5

GetObjMaxParamsFunction · 0.85
GetObjectPtrPropertyFunction · 0.85
DetermineTargetHwndFunction · 0.85
BIF_DECLFunction · 0.85
ValidateFunctorFunction · 0.85

Calls 6

ExprTokenTypeClass · 0.85
SetExitResultMethod · 0.80
ErrorMethod · 0.80
UnknownMemberErrorMethod · 0.80
InvokeMethod · 0.45
FreeMethod · 0.45

Tested by

no test coverage detected