10 #ifndef _STRUS_ANALYZER_DOCUMENT_CLASS_HPP_INCLUDED
11 #define _STRUS_ANALYZER_DOCUMENT_CLASS_HPP_INCLUDED
28 const std::string& mimeType_) :m_mimeType(mimeType_){}
31 const std::string& mimeType_,
32 const std::string& encoding_) :m_mimeType(mimeType_),m_encoding(encoding_){}
35 const std::string& mimeType_,
36 const std::string& encoding_,
37 const std::string& scheme_) :m_mimeType(mimeType_),m_scheme(scheme_),m_encoding(encoding_){}
39 #if __cplusplus >= 201103L
50 void setMimeType(
const std::string& mimeType_) {m_mimeType = mimeType_;}
53 void setScheme(
const std::string& scheme_) {m_scheme = scheme_;}
56 void setEncoding(
const std::string& encoding_) {m_encoding = encoding_;}
60 const std::string&
mimeType()
const {
return m_mimeType;}
63 const std::string&
scheme()
const {
return m_scheme;}
66 const std::string&
encoding()
const {
return m_encoding;}
70 bool defined()
const {
return !m_mimeType.empty();}
74 int level()
const {
return m_mimeType.empty()?0:(1+!m_scheme.empty()+!m_encoding.empty());}
77 std::string m_mimeType;
79 std::string m_encoding;
Defines a description of the properties of an original document processed by the segmenter.
Definition: documentClass.hpp:21
DocumentClass(const std::string &mimeType_)
Constructor.
Definition: documentClass.hpp:27
DocumentClass(const std::string &mimeType_, const std::string &encoding_)
Constructor.
Definition: documentClass.hpp:30
const std::string & mimeType() const
Get the MIME type of the document class.
Definition: documentClass.hpp:60
void setMimeType(const std::string &mimeType_)
Set the MIME type of the document class.
Definition: documentClass.hpp:50
void setScheme(const std::string &scheme_)
Set the scheme identifier of the document class.
Definition: documentClass.hpp:53
const std::string & encoding() const
Get the character set encoding of the document class.
Definition: documentClass.hpp:66
bool defined() const
Evaluate if this document class definition is defined.
Definition: documentClass.hpp:70
DocumentClass()
Default constructor.
Definition: documentClass.hpp:25
void setEncoding(const std::string &encoding_)
Set the character set encoding of the document class.
Definition: documentClass.hpp:56
int level() const
Evaluate the level of definition of the document class.
Definition: documentClass.hpp:74
DocumentClass(const std::string &mimeType_, const std::string &encoding_, const std::string &scheme_)
Constructor.
Definition: documentClass.hpp:34
DocumentClass(const DocumentClass &o)
Copy constructor.
Definition: documentClass.hpp:45
const std::string & scheme() const
Get the scheme identifier of the document class.
Definition: documentClass.hpp:63