HP LoadRunner Protocol SDK Test Run API Reference  12.02
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ApiFunctionWithNamedArgs.h
Go to the documentation of this file.
1 #ifndef LR_PROTOCOL_SDK_API_FUNCTIONS_WITH_NAMED_ARGS_H_
4 #define LR_PROTOCOL_SDK_API_FUNCTIONS_WITH_NAMED_ARGS_H_
5 
6 
7 
8 #include "ApiFunctions.h"
9 #include <stddef.h>
10 class CArguments;
11 
12 typedef bool ( *StringArgumentValidationType)(const char* );
13 typedef bool ( *BooleanArgumentValidationType)(bool );
14 typedef bool ( *NumericArgumentValidationType)(double );
15 
16 
34 class PROTOCOL_EXTENSION_DECLSPEC CApiFunctionWithNamedArguments : public CApiFunction
35 {
36 
37 public:
42  const char* mDisplayName = "",
43  int mIconId = -1
44  );
45 
48 
52  void DefineStringArgument(
53  const char* mKey,
54  bool mIsOptional,
55  const char* mDefaultValue = "",
56  StringArgumentValidationType mValidationCallback = NULL
57  );
58 
62  void DefineBooleanArgument(
63  const char* mKey,
64  bool mIsOptional,
65  bool mDefaultValue = true,
66  BooleanArgumentValidationType mValidationCallback = NULL
67  );
68 
72  void DefineNumericArgument(
73  const char* mKey,
74  bool mIsOptional,
75  double mDefaultValue = 0,
76  NumericArgumentValidationType mValidationCallback = NULL
77  );
78 
79 
86  const char*
87  GetStringArgumentValue(
88  const char* mKey
89  ) const;
90 
97  bool
98  GetBooleanArgumentValue(
99  const char* mKey
100  ) const;
101 
108  double
109  GetNumericArgumentValue(
110  const char* mKey
111  ) const;
112 
119  bool IsSpecified(
120  const char* mKey
121  ) const;
122 
123 protected:
124 
133  virtual void
135  va_list mVaList
136  );
137 
146  virtual bool CrossArgumentValidation();
147 
148 private:
149 
151  CApiFunctionWithNamedArguments& operator=(const CApiFunctionWithNamedArguments& ) {return *this;} // don't copy
152 
161  void ParseArguments(va_list mVaList);
162 
163  CArguments* m_arguments;
164 };
165 
166 
167 
168 
169 #endif
The template for an API function that is declared with named arguments ("key=value").
Definition: ApiFunctionWithNamedArgs.h:34
bool(* StringArgumentValidationType)(const char *)
A string argument validation function.
Definition: ApiFunctionWithNamedArgs.h:12
This file contains declarations of protocol API function calls with positional arguments.
virtual void HandleArguments(va_list mVaList)
Validates arguments and checks for completeness.
bool(* BooleanArgumentValidationType)(bool)
A boolean argument validation function.
Definition: ApiFunctionWithNamedArgs.h:13
The base class for handling API execution.
Definition: ApiFunctions.h:27
bool(* NumericArgumentValidationType)(double)
A numeric argument validation function.
Definition: ApiFunctionWithNamedArgs.h:14


Send documentation feedback to HP.


© 1995-2015 Hewlett-Packard Development Company, L.P.