Public Member Functions | |
Content (ContentItem &item, const std::string baseUrl, const std::string &contentDirectory, const std::string id) | |
Content (ContentItem &item, const std::string baseUrl, const std::string &contentDirectory, const mico::rdf::model::URI &uri) | |
const mico::rdf::model::URI | getURI () |
Return the URI uniquely identifying this content part. More... | |
void | setType (const std::string type) |
Set the type of this content part using an arbitrary string identifier (e.g. More... | |
std::string | getType () |
Return the type of this content part using an arbitrary string identifier (e.g. More... | |
void | setProperty (const mico::rdf::model::URI &property, const std::string value) |
Set the property with the given URI to the given value. More... | |
std::string | getProperty (const mico::rdf::model::URI &property) |
Return the property value of this content part for the given property. More... | |
void | setRelation (const mico::rdf::model::URI &property, const mico::rdf::model::URI &value) |
Set the property with the given URI to the given value. More... | |
mico::rdf::model::Value * | getRelation (const mico::rdf::model::URI &property) |
Return the property value of this content part for the given property. More... | |
std::ostream * | getOutputStream () |
Return a new output stream for writing to the content. More... | |
std::istream * | getInputStream () |
Return a new input stream for reading the content. More... | |
void | deleteContent () |
Delete the binary data associated with this content object, if any. More... | |
Protected Attributes | |
ContentItem & | item |
const std::string | baseUrl |
std::string | id |
const std::string & | contentDirectory |
Friends | |
bool | operator== (Content &c1, Content &c2) |
void mico::persistence::Content::deleteContent | ( | ) |
Delete the binary data associated with this content object, if any.
Otherwise, do nothing.
std::istream * mico::persistence::Content::getInputStream | ( | ) |
Return a new input stream for reading the content.
std::ostream * mico::persistence::Content::getOutputStream | ( | ) |
Return a new output stream for writing to the content.
Any existing content will be overwritten.
string mico::persistence::Content::getProperty | ( | const mico::rdf::model::URI & | property | ) |
Return the property value of this content part for the given property.
Use e.g. in combination with fixed vocabularies.
Value * mico::persistence::Content::getRelation | ( | const mico::rdf::model::URI & | property | ) |
Return the property value of this content part for the given property.
Return the relation target of this content part for the given property.
Use e.g. in combination with fixed vocabularies.
string mico::persistence::Content::getType | ( | ) |
Return the type of this content part using an arbitrary string identifier (e.g.
a MIME type or another symbolic representation). Ideally, the type comes from a controlled vocabulary.
const mico::rdf::model::URI mico::persistence::Content::getURI | ( | ) |
Return the URI uniquely identifying this content part.
The URI should be either a UUID or constructed in a way that it derives from the ContentItem this part belongs to.
void mico::persistence::Content::setProperty | ( | const mico::rdf::model::URI & | property, |
const std::string | value | ||
) |
Set the property with the given URI to the given value.
Use e.g. in combination with fixed vocabularies.
void mico::persistence::Content::setRelation | ( | const mico::rdf::model::URI & | property, |
const mico::rdf::model::URI & | value | ||
) |
Set the property with the given URI to the given value.
Set the relation with the given URI to the given target resource.
Use e.g. in combination with fixed vocabularies.
void mico::persistence::Content::setType | ( | const std::string | type | ) |
Set the type of this content part using an arbitrary string identifier (e.g.
a MIME type or another symbolic representation). Ideally, the type comes from a controlled vocabulary.
type |