本文整理汇总了C++中ExportContext::reportError方法的典型用法代码示例。如果您正苦于以下问题:C++ ExportContext::reportError方法的具体用法?C++ ExportContext::reportError怎么用?C++ ExportContext::reportError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExportContext
的用法示例。
在下文中一共展示了ExportContext::reportError方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xmlExportBegin
void MediaFormatIO::xmlExportBegin(
ExportContext& context) const {
switch(m_format.type) {
case B_MEDIA_RAW_AUDIO:
context.beginElement(s_raw_audio_tag);
break;
case B_MEDIA_RAW_VIDEO:
context.beginElement(s_raw_video_tag);
break;
case B_MEDIA_MULTISTREAM:
context.beginElement(s_multistream_tag);
break;
case B_MEDIA_ENCODED_AUDIO:
context.beginElement(s_encoded_audio_tag);
break;
case B_MEDIA_ENCODED_VIDEO:
context.beginElement(s_encoded_video_tag);
break;
default:
// +++++ not very polite
context.reportError("MediaFormatIO: type not supported\n");
break;
}
}
示例2: xmlExportBegin
__USE_CORTEX_NAMESPACE
// -------------------------------------------------------- //
// EXPORT [not implemented]
// -------------------------------------------------------- //
void StringContent::xmlExportBegin(
ExportContext& context) const {
context.reportError("StringContent: no export");
}
示例3: xmlExportBegin
// -------------------------------------------------------- //
void ConnectionIO::xmlExportBegin(
ExportContext& context) const {
if(!m_exportValid) {
context.reportError(
"ConnectionIO::xmlExportBegin():\n"
"*** invalid ***\n");
return;
}
context.beginElement(_CONNECTION_ELEMENT);
}
示例4: xmlExportBegin
void RouteAppNodeManager::xmlExportBegin(
ExportContext& context) const {
status_t err;
try {
NodeSetIOContext& set = dynamic_cast<NodeSetIOContext&>(context);
context.beginElement(_NODE_SET_ELEMENT);
// validate the node set
for(int n = set.countNodes()-1; n >= 0; --n) {
media_node_id id = set.nodeAt(n);
ASSERT(id != media_node::null.node);
// fetch node
NodeRef* ref;
err = getNodeRef(id, &ref);
if(err < B_OK) {
D_SETTINGS((
"! RVNM::xmlExportBegin(): node %ld doesn't exist\n", id));
set.removeNodeAt(n);
continue;
}
// skip unless internal
if(!ref->isInternal()) {
D_SETTINGS((
"! RVNM::xmlExportBegin(): node %ld not internal; skipping.\n", id));
set.removeNodeAt(n);
continue;
}
}
}
catch(bad_cast& e) {
context.reportError("RouteAppNodeManager: expected a NodeSetIOContext\n");
}
}
示例5: xmlExportEnd
void StringContent::xmlExportEnd(
ExportContext& context) const {
context.reportError("StringContent: no export");
}
示例6: xmlExportContent
void RouteAppNodeManager::xmlExportContent(
ExportContext& context) const {
status_t err;
try {
NodeSetIOContext& nodeSet = dynamic_cast<NodeSetIOContext&>(context);
context.beginContent();
// write nodes; enumerate connections
typedef map<uint32,Connection> connection_map;
connection_map connections;
int count = nodeSet.countNodes();
for(int n = 0; n < count; ++n) {
media_node_id id = nodeSet.nodeAt(n);
ASSERT(id != media_node::null.node);
// fetch node
NodeRef* ref;
err = getNodeRef(id, &ref);
if(err < B_OK) {
D_SETTINGS((
"! RouteAppNodeManager::xmlExportContent():\n"
" getNodeRef(%ld) failed: '%s'\n",
id, strerror(err)));
continue;
}
// fetch connections
vector<Connection> conSet;
ref->getInputConnections(conSet);
ref->getOutputConnections(conSet);
for(uint32 c = 0; c < conSet.size(); ++c)
// non-unique connections will be rejected:
connections.insert(
connection_map::value_type(conSet[c].id(), conSet[c]));
// create an IO object for the node & write it
DormantNodeIO io(ref, nodeSet.keyAt(n));
if(context.writeObject(&io) < B_OK)
// abort
return;
}
// write connections
for(connection_map::const_iterator it = connections.begin();
it != connections.end(); ++it) {
ConnectionIO io(
&(*it).second,
this,
&nodeSet);
if(context.writeObject(&io) < B_OK)
// abort
return;
}
// +++++ write groups
// write UI state
{
BMessage m;
nodeSet.exportUIState(&m);
context.beginElement(_UI_STATE_ELEMENT);
context.beginContent();
MessageIO io(&m);
context.writeObject(&io);
context.endElement();
}
}
catch(bad_cast& e) {
context.reportError("RouteAppNodeManager: expected a NodeSetIOContext\n");
}
}