/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return found;
}
+bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string& params ) const
+{
+ bool found = false;
+ for( size_t i=0; i < mCallStack.size(); i++ )
+ {
+ if( 0 == mCallStack[i].method.compare(method) )
+ {
+ found = true;
+ params = mCallStack[i].paramList;
+ break;
+ }
+ }
+ return found;
+}
+
int TraceCallStack::CountMethod(std::string method) const
{
int numCalls = 0;
return FindIndexFromMethodAndParams( method, params ) > -1;
}
+bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
+{
+ for( size_t i = startIndex; i < mCallStack.size(); ++i )
+ {
+ if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
+ {
+ startIndex = i;
+ return true;
+ }
+ }
+ return false;
+}
/**
* Search for a method in the stack with the given parameter list
* @param[in] params A comma separated list of parameter values
* @return index in the stack where the method was found or -1 otherwise
*/
-int TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
+int32_t TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
{
- int index = -1;
+ int32_t index = -1;
for( size_t i=0; i < mCallStack.size(); i++ )
{
if( 0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params) )
{
- index = i;
+ index = static_cast<int32_t>( i );
break;
}
}
int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
{
- int index = -1;
+ int32_t index = -1;
for( size_t i=0; i < mCallStack.size(); i++ )
{
if( 0 == mCallStack[i].method.compare(method) )
}
if( match == true )
{
- index = i;
+ index = static_cast<int32_t>( i );
break;
}
}