本文整理汇总了C++中EventType::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ EventType::getName方法的具体用法?C++ EventType::getName怎么用?C++ EventType::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventType
的用法示例。
在下文中一共展示了EventType::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: validateType
// Checks if type is valid. Does this by finding the hash value of the name
// and then checking if the names match if that hash number is already taken.
bool EventManager::validateType(EventType const & type)
{
if (type.getName() == NULL)
return false;
if (type.getId() == 0)
return false;
EventTypeSet::iterator it = m_eventTypes.find(type);
if (it != m_eventTypes.end())
{
EventType known = (*it);
char * const oldName = known.getName();
char * const newName = type.getName();
int check = strcmp(oldName, newName);
assert(check==0 && "Event types hashed wrong!");
if (check!=0)
return false;
}
return true;
}
示例2: main
int main(int argc, char* argv[]) {
if (argc < 4) {
std::cerr << "Usage: " << argv[0] << " <application-key> <username> <password>" << std::endl;
return 1;
}
ExchangeApi exchangeApi(argv[1]);
if (exchangeApi.login(argv[2], argv[3])) {
MarketFilter filter;
ListEventTypesRequest req(filter);
if (req.isValid()) {
ListEventTypesResponse resp = exchangeApi.listEventTypes(req);
if (resp.isSuccess()) {
std::vector<EventTypeResult> eventTypeResults = resp.getEventTypeResults();
for (unsigned i = 0; i < eventTypeResults.size(); ++i) {
EventTypeResult etr = eventTypeResults[i];
EventType et = etr.getEventType();
std::cout << et.getId() << " " << et.getName() << std::endl;
}
} else {
std::cout << "request failed: " << resp.getFaultCode() << " " << resp.getFaultString() << std::endl;
}
} else {
std::cout << "invalid request: " << req.toString() << std::endl;
}
} else {
std::cout << "failed to log in" << std::endl;
}
}