本文整理汇总了C++中CIMDateTime::equal方法的典型用法代码示例。如果您正苦于以下问题:C++ CIMDateTime::equal方法的具体用法?C++ CIMDateTime::equal怎么用?C++ CIMDateTime::equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIMDateTime
的用法示例。
在下文中一共展示了CIMDateTime::equal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parser
// Tests PROPERTY.ARRAY as an embedded object with array type.
static void testGetInstanceElement2(const char* testDataFile)
{
CIMInstance cimInstance;
Buffer text;
FileSystem::loadFileToMemory(text, testDataFile);
XmlParser parser((char*)text.getData());
XmlReader::getInstanceElement(parser, cimInstance);
PEGASUS_TEST_ASSERT(cimInstance.getClassName() ==
CIMName("CIM_InstCreation"));
Uint32 idx;
CIMProperty cimProperty;
CIMValue cimValue;
CIMType cimType;
PEGASUS_TEST_ASSERT(cimInstance.getPropertyCount() == 3);
idx = cimInstance.findProperty(CIMName("IndicationIdentifier"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimInstance.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "string") == 0);
String myString;
cimValue.get(myString);
PEGASUS_TEST_ASSERT(strcmp(myString.getCString(), "0") == 0);
idx = cimInstance.findProperty(CIMName("IndicationTime"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimInstance.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "datetime") == 0);
CIMDateTime myDateTime;
cimValue.get(myDateTime);
PEGASUS_TEST_ASSERT(myDateTime.equal(
CIMDateTime("20050227225624.524000-300")));
idx = cimInstance.findProperty(CIMName("SourceInstance"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimInstance.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "object") == 0);
Array<CIMObject> cimObject;
cimValue.get(cimObject);
PEGASUS_TEST_ASSERT(cimObject.size() == 2);
for (idx = 0; idx < cimObject.size(); idx++)
{
CIMInstance cimInstanceElement(cimObject[idx]);
PEGASUS_TEST_ASSERT(cimInstanceElement.getPropertyCount() == 2);
Uint32 propIdx = cimInstanceElement.findProperty(CIMName("uniqueId"));
if (propIdx != PEG_NOT_FOUND)
{
CIMProperty nestedProperty =
cimInstanceElement.getProperty(propIdx);
cimValue = nestedProperty.getValue();
Uint32 uniqueId;
cimValue.get(uniqueId);
propIdx = cimInstanceElement.findProperty(CIMName("lastOp"));
nestedProperty = cimInstanceElement.getProperty(propIdx);
cimValue = nestedProperty.getValue();
String checkStringValue;
cimValue.get(checkStringValue);
if (uniqueId == 1)
{
PEGASUS_TEST_ASSERT(strcmp(
checkStringValue.getCString(), "createInstance") == 0);
}
else if (uniqueId == 2)
{
PEGASUS_TEST_ASSERT(strcmp(
checkStringValue.getCString(), "deleteInstance") == 0);
}
else
{
PEGASUS_TEST_ASSERT(false);
}
}
}
}
示例2: testGetInstanceElement
// Tests PROPERTY as an embedded object.
static void testGetInstanceElement(const char* testDataFile)
{
//--------------------------------------------------------------------------
// Read in instance
//--------------------------------------------------------------------------
CIMInstance cimInstance;
Buffer text;
FileSystem::loadFileToMemory(text, testDataFile);
XmlParser parser((char*)text.getData());
XmlReader::getInstanceElement(parser, cimInstance);
PEGASUS_TEST_ASSERT(
cimInstance.getClassName() == CIMName("CIM_InstCreation"));
Uint32 idx;
CIMProperty cimProperty;
CIMValue cimValue;
CIMType cimType;
PEGASUS_TEST_ASSERT(cimInstance.getPropertyCount() == 3);
idx = cimInstance.findProperty(CIMName("IndicationIdentifier"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimInstance.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "string") == 0);
String myString;
cimValue.get(myString);
PEGASUS_TEST_ASSERT(strcmp(myString.getCString(), "0") == 0);
idx = cimInstance.findProperty(CIMName("IndicationTime"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimInstance.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "datetime") == 0);
CIMDateTime myDateTime;
cimValue.get(myDateTime);
PEGASUS_TEST_ASSERT(myDateTime.equal(
CIMDateTime("20050227225624.524000-300")));
idx = cimInstance.findProperty(CIMName("SourceInstance"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimInstance.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "object") == 0);
CIMObject cimObject;
cimValue.get(cimObject);
PEGASUS_TEST_ASSERT(
cimObject.getClassName() ==
CIMName("Sample_LifecycleIndicationProviderClass"));
PEGASUS_TEST_ASSERT(cimObject.getPropertyCount() == 2);
idx = cimObject.findProperty(CIMName("uniqueId"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimObject.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "uint32") == 0);
Uint32 myUint32;
cimValue.get(myUint32);
PEGASUS_TEST_ASSERT(myUint32 == 1);
idx = cimObject.findProperty(CIMName("lastOp"));
PEGASUS_TEST_ASSERT(idx != PEG_NOT_FOUND);
cimProperty = cimObject.getProperty(idx);
cimValue = cimProperty.getValue();
cimType = cimProperty.getType();
PEGASUS_TEST_ASSERT(strcmp(cimTypeToString(cimType), "string") == 0);
cimValue.get(myString);
PEGASUS_TEST_ASSERT(strcmp(myString.getCString(), "createInstance") == 0);
}
示例3:
bool operator==(const CIMDateTime& x, const CIMDateTime& y)
{
return x.equal(y);
}