本文整理汇总了C++中LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE函数的典型用法代码示例。如果您正苦于以下问题:C++ LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE函数的具体用法?C++ LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE怎么用?C++ LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: librdf_new_uri_from_uri
/**
* librdf_new_uri_from_uri:
* @old_uri: #librdf_uri object
*
* Copy constructor - create a new librdf_uri object from an existing librdf_uri object.
*
* Return value: a new #librdf_uri object or NULL on failure
**/
librdf_uri*
librdf_new_uri_from_uri (librdf_uri* old_uri)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(old_uri, librdf_uri, NULL);
return raptor_uri_copy(old_uri);
}
示例2: librdf_uri_to_filename
/**
* librdf_uri_to_filename:
* @uri: #librdf_uri object
*
* Return pointer to filename of URI.
*
* Returns a pointer to a newly allocated buffer that
* the caller must free. This will fail if the URI
* is not a file: URI. This can be checked with #librdf_uri_is_file_uri
*
* Return value: pointer to filename or NULL on failure
**/
const char*
librdf_uri_to_filename(librdf_uri* uri)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL);
return raptor_uri_uri_string_to_filename(librdf_uri_as_string(uri));
}
示例3: librdf_statement_decode
/**
* librdf_statement_decode:
* @statement: the statement to deserialise into
* @buffer: the buffer to use
* @length: buffer size
*
* Decodes a statement from a buffer.
*
* Decodes the serialised statement (as created by librdf_statement_encode() )
* from the given buffer.
*
* Return value: number of bytes used or 0 on failure (bad encoding, allocation failure)
**/
size_t
librdf_statement_decode(librdf_statement* statement,
unsigned char *buffer, size_t length)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, librdf_statement, 0);
return librdf_statement_decode_parts(statement, NULL, buffer, length);
}
示例4: librdf_serializer_serialize_stream_to_counted_string
/**
* librdf_serializer_serialize_stream_to_counted_string:
* @serializer: the serializer
* @base_uri: the base URI to use (or NULL)
* @stream: the #librdf_stream stream to use
* @length_p: pointer to store length or NULL
*
* Write a #librdf_stream to a counted string.
*
* Return value: stream as string or NULL on failure
**/
unsigned char*
librdf_serializer_serialize_stream_to_counted_string(librdf_serializer* serializer,
librdf_uri* base_uri,
librdf_stream* stream,
size_t* length_p)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(serializer, librdf_serializer, NULL);
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, librdf_stream, NULL);
if(length_p)
*length_p=0;
return serializer->factory->serialize_stream_to_counted_string(serializer->context,
base_uri,
stream,
length_p);
}
示例5: librdf_new_uri_from_uri
/**
* librdf_new_uri_from_uri:
* @old_uri: #librdf_uri object
*
* Copy constructor - create a new librdf_uri object from an existing librdf_uri object.
*
* Return value: a new #librdf_uri object or NULL on failure
**/
librdf_uri*
librdf_new_uri_from_uri (librdf_uri* old_uri) {
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(old_uri, librdf_uri, NULL);
old_uri->usage++;
return old_uri;
}
示例6: librdf_storage_context_serialise
/**
* librdf_storage_context_serialise - List all statements in a storage context (DEPRECATED)
* @storage: &librdf_storage object
* @context: &librdf_node context node
*
* DEPRECATED to reduce confusion with the librdf_serializer class.
* Please use librdf_storage_context_as_stream.
*
* Return value: &librdf_stream of statements or NULL on failure or context is empty
**/
librdf_stream*
librdf_storage_context_serialise(librdf_storage* storage,
librdf_node* context)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL);
return librdf_storage_context_as_stream(storage, context);
}
示例7: librdf_new_node
/**
* librdf_new_node:
* @world: redland world object
*
* Constructor - create a new #librdf_node object with a private identifier.
*
* Calls librdf_new_node_from_blank_identifier(world, NULL) to
* construct a new redland blank node identifier and make a
* new librdf_node object for it.
*
* Return value: a new #librdf_node object or NULL on failure
**/
librdf_node*
librdf_new_node(librdf_world *world)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL);
librdf_world_open(world);
return librdf_new_node_from_blank_identifier(world, (unsigned char*)NULL);
}
示例8: librdf_new_node_from_uri
/**
* librdf_new_node_from_uri:
* @world: redland world object
* @uri: #librdf_uri object
*
* Constructor - create a new resource #librdf_node object with a given URI.
*
* Return value: a new #librdf_node object or NULL on failure
**/
librdf_node*
librdf_new_node_from_uri(librdf_world *world, librdf_uri *uri)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL);
librdf_world_open(world);
return raptor_new_term_from_uri(world->raptor_world_ptr, uri);
}
示例9: librdf_uri_as_counted_string
/**
* librdf_uri_as_counted_string:
* @uri: #librdf_uri object
* @len_p: pointer to location to store length
*
* Get a pointer to the string representation of the URI with length.
*
* Returns a shared pointer to the URI string representation.
* Note: does not allocate a new string so the caller must not free it.
*
* Return value: string representation of URI
**/
unsigned char*
librdf_uri_as_counted_string(librdf_uri *uri, size_t* len_p)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL);
if(len_p)
*len_p=uri->string_length;
return uri->string;
}
示例10: librdf_query_results_get_binding_value_by_name
/**
* librdf_query_results_get_binding_value_by_name:
* @query_results: #librdf_query_results query results
* @name: variable name
*
* Get one binding value for a given name in the current result.
*
* Return value: a new #librdf_node binding value or NULL on failure
**/
librdf_node*
librdf_query_results_get_binding_value_by_name(librdf_query_results *query_results, const char *name)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, NULL);
if(query_results->query->factory->results_get_binding_value_by_name)
return query_results->query->factory->results_get_binding_value_by_name(query_results, name);
else
return NULL;
}
示例11: librdf_node_get_literal_value_language
/**
* librdf_node_get_literal_value_language:
* @node: the node object
*
* Get the XML language of the node.
*
* Returns a pointer to the literal language value held by the node, it must
* be copied if it is wanted to be used by the caller.
*
* Return value: the XML language string or NULL if node is not a literal
* or there is no XML language defined.
**/
char*
librdf_node_get_literal_value_language(librdf_node *node)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(node, librdf_node, NULL);
if(node->type != RAPTOR_TERM_TYPE_LITERAL)
return NULL;
return (char*)node->value.literal.language;
}
示例12: librdf_query_results_finished
/**
* librdf_query_results_finished:
* @query_results: #librdf_query_results query results
*
* Find out if binding results are exhausted.
*
* Return value: non-0 if results are finished or query failed
**/
int
librdf_query_results_finished(librdf_query_results *query_results)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, librdf_query_results, 1);
if(query_results->query->factory->results_finished)
return query_results->query->factory->results_finished(query_results);
else
return 1;
}
示例13: librdf_query_results_get_boolean
/**
* librdf_query_results_get_boolean:
* @query_results: #librdf_query_results query_results
*
* Get boolean query result.
*
* The return value is only meaningful if this is a boolean
* query result - see librdf_query_results_is_boolean()
*
* Return value: boolean query result - >0 is true, 0 is false, <0 on error or finished
*/
int
librdf_query_results_get_boolean(librdf_query_results* query_results)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(query_results, query_results, -1);
if(query_results->query->factory->results_get_boolean)
return query_results->query->factory->results_get_boolean(query_results);
else
return -1;
}
示例14: librdf_new_node_from_uri_string
/**
* librdf_new_node_from_uri_string:
* @world: redland world object
* @uri_string: string representing a URI
*
* Constructor - create a new #librdf_node object from a URI string.
*
* Return value: a new #librdf_node object or NULL on failure
**/
librdf_node*
librdf_new_node_from_uri_string(librdf_world *world,
const unsigned char *uri_string)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, librdf_world, NULL);
librdf_world_open(world);
return raptor_new_term_from_uri_string(world->raptor_world_ptr, uri_string);
}
示例15: librdf_storage_get_contexts
/**
* librdf_storage_get_contexts - return the list of contexts in the store
* @storage: &librdf_storage object
*
* Returns an iterator of &librdf_node context nodes for each
* context in the store.
*
* Return value: &librdf_iterator of context nodes or NULL on failure or if contexts are not supported
**/
librdf_iterator*
librdf_storage_get_contexts(librdf_storage* storage)
{
LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(storage, librdf_storage, NULL);
if(storage->factory->get_contexts)
return storage->factory->get_contexts(storage);
else
return NULL;
}