text
stringlengths
0
2.2M
case TestEnum::VALUE1:
*result = TestEnum::VALUE1;
return 0; // RETURN
case TestEnum::VALUE2:
*result = TestEnum::VALUE2;
return 0; // RETURN
case TestEnum::VALUE3:
*result = TestEnum::VALUE3;
return 0; // RETURN
}
return -1;
}
template <>
int fromString<TestEnum::Value>(TestEnum::Value *result,
const char *string,
int stringLength)
{
if ("VALUE1" == bsl::string(string, stringLength)) {
*result = TestEnum::VALUE1;
return 0; // RETURN
}
if ("VALUE2" == bsl::string(string, stringLength)) {
*result = TestEnum::VALUE2;
return 0; // RETURN
}
if ("VALUE3" == bsl::string(string, stringLength)) {
*result = TestEnum::VALUE3;
return 0; // RETURN
}
return -1;
}
} // close namespace bdlat_EnumFunctions
} // close enterprise namespace
// test_customizedint.h -*-C++-*-
//@PURPOSE: todo: provide purpose.
//
//@CLASSES:
// CustomizedInt: a customized integer
//
//@DESCRIPTION:
// todo: provide annotation for 'CustomizedInt'
namespace BloombergLP {
namespace s_baltst {
class CustomizedInt {
private:
// PRIVATE DATA MEMBERS
int d_value; // stored value
// FRIENDS
friend bool operator==(const CustomizedInt&, const CustomizedInt&);
friend bool operator!=(const CustomizedInt&, const CustomizedInt&);
public:
// TYPES
typedef int BaseType;
// CONSTANTS
static const char CLASS_NAME[];
// the name of this class (i.e., "CustomizedInt")
// CREATORS
CustomizedInt();
// Create an object of type 'CustomizedInt' having the default value.
CustomizedInt(const CustomizedInt& original);
// Create an object of type 'CustomizedInt' having the value of the
// specified 'original' object.
explicit CustomizedInt(int value);
// Create an object of type 'CustomizedInt' having the specified
// 'value'.
~CustomizedInt();
// Destroy this object.
// MANIPULATORS
CustomizedInt& operator=(const CustomizedInt& rhs);
// Assign to this object the value of the specified 'rhs' object.
void reset();
// Reset this object to the default value (i.e., its value upon
// default construction).
int fromInt(int value);
// Convert from the specified 'value' to this type. Return 0 if
// successful and non-zero otherwise.
// ACCESSORS