version 1.6, 2008/12/16 18:56:00
|
version 1.7, 2009/11/30 16:49:46
|
|
|
}; | }; |
| |
template<class T> | template<class T> |
static void _print(ostream& os, const T& x) |
struct Print |
|
{ |
|
static void func(ostream& os, const T& x) |
{ | { |
os << x; | os << x; |
} | } |
|
}; |
| |
PEGASUS_TEMPLATE_SPECIALIZATION | PEGASUS_TEMPLATE_SPECIALIZATION |
void _print(ostream& os, const Boolean& x) |
struct Print<Boolean> |
|
{ |
|
static void func(ostream& os, const Boolean& x) |
{ | { |
os << (x ? "true" : "false"); | os << (x ? "true" : "false"); |
} | } |
|
}; |
| |
PEGASUS_TEMPLATE_SPECIALIZATION | PEGASUS_TEMPLATE_SPECIALIZATION |
void _print(ostream& os, const Uint64& x) |
struct Print<Uint64> |
|
{ |
|
static void func(ostream& os, const Uint64& x) |
{ | { |
char buf[32]; | char buf[32]; |
sprintf(buf, "%" PEGASUS_64BIT_CONVERSION_WIDTH "u", x); | sprintf(buf, "%" PEGASUS_64BIT_CONVERSION_WIDTH "u", x); |
os << buf; | os << buf; |
} | } |
|
}; |
| |
PEGASUS_TEMPLATE_SPECIALIZATION | PEGASUS_TEMPLATE_SPECIALIZATION |
void _print(ostream& os, const Sint64& x) |
struct Print<Sint64> |
|
{ |
|
static void func(ostream& os, const Sint64& x) |
{ | { |
char buf[32]; | char buf[32]; |
sprintf(buf, "%" PEGASUS_64BIT_CONVERSION_WIDTH "d", x); | sprintf(buf, "%" PEGASUS_64BIT_CONVERSION_WIDTH "d", x); |
os << buf; | os << buf; |
} | } |
|
}; |
| |
PEGASUS_TEMPLATE_SPECIALIZATION | PEGASUS_TEMPLATE_SPECIALIZATION |
void _print(ostream& os, const Char16& x) |
struct Print<Uint16> |
|
{ |
|
static void func(ostream& os, const Char16& x) |
{ | { |
os << Uint16(x); | os << Uint16(x); |
} | } |
|
}; |
| |
PEGASUS_TEMPLATE_SPECIALIZATION | PEGASUS_TEMPLATE_SPECIALIZATION |
void _print(ostream& os, const CIMDateTime& x) |
struct Print<CIMDateTime> |
|
{ |
|
static void func(ostream& os, const CIMDateTime& x) |
{ | { |
os << x.toString(); | os << x.toString(); |
} | } |
|
}; |
| |
template<class T> | template<class T> |
struct PrintArray | struct PrintArray |
|
|
| |
for (Uint32 i = 0; i < a.size(); i++) | for (Uint32 i = 0; i < a.size(); i++) |
{ | { |
_print<T>(os, a[i]); |
const T& r = a[i]; |
|
Print<T>::func(os, r); |
| |
if (i + 1 != a.size()) | if (i + 1 != a.size()) |
os << ", "; | os << ", "; |
|
|
{ | { |
T x; | T x; |
cv.get(x); | cv.get(x); |
_print<T>(os, x); |
Print<T>::func(os, x); |
os << endl; | os << endl; |
} | } |
}; | }; |
|
|
os << Ind(n) << "}" << endl; | os << Ind(n) << "}" << endl; |
} | } |
| |
|
PEGASUS_COMMON_LINKAGE void PrintParamValue( |
|
PEGASUS_STD(ostream)& os, |
|
const CIMParamValue& x, |
|
Uint32 n) |
|
{ |
|
os << Ind(n) << "CIMParamValue" << endl; |
|
os << Ind(n) << "{" << endl; |
|
os << Ind(n) << " name=" << x.getParameterName() << endl; |
|
PrintValue(os, x.getValue(), n + 1); |
|
os << Ind(n) << "}" << endl; |
|
} |
|
|
|
PEGASUS_COMMON_LINKAGE void PrintParamValueArray( |
|
PEGASUS_STD(ostream)& os, |
|
const Array<CIMParamValue>& x, |
|
Uint32 n) |
|
{ |
|
os << Ind(n) << "Array<CIMParamValue>" << endl; |
|
os << Ind(n) << "{" << endl; |
|
|
|
for (Uint32 i = 0; i < x.size(); i++) |
|
{ |
|
PrintParamValue(os, x[i], n + 1); |
|
} |
|
|
|
os << Ind(n) << "}" << endl; |
|
} |
|
|
#endif /* defined(PEGASUS_DEBUG) */ | #endif /* defined(PEGASUS_DEBUG) */ |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |