00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TYPES_INCLUDES
00022 #error "You can't include messages.h directly; Instead, You have to include types.h"
00023 #endif
00024
00025 #ifndef MESSAGGES_H
00026 #define MESSAGGES_H
00027
00028 namespace nnfw {
00029
00035
00036 class nnfwStringPrivate;
00037
00040 class NNFW_API nnfwString {
00041 public:
00045 nnfwString();
00047 ~nnfwString();
00049 nnfwString( const nnfwString& );
00051 nnfwString( int );
00053 nnfwString( unsigned int );
00055 nnfwString( double );
00057 nnfwString( float );
00059 nnfwString( char );
00061 nnfwString( const char* );
00063
00066 nnfwString& append( const nnfwString& p );
00068 nnfwString& operator=( const nnfwString& left );
00070 bool operator==( const nnfwString& left );
00072 const char* toUtf8() const;
00074 private:
00075 nnfwStringPrivate* prv;
00076 };
00077
00080 class NNFW_API nMessage {
00081 public:
00085 nMessage();
00087 ~nMessage() { };
00089 protected:
00090
00091 class NNFW_API msgLine {
00092 public:
00093 msgLine( nMessage* parent );
00094 ~msgLine();
00095 msgLine& operator<<( const nnfwString& part ) {
00096 msg.append( part );
00097 return (*this);
00098 };
00099 void set( const nnfwString& str ) {
00100 msg = str;
00101 };
00102 private:
00103 nMessage* parent;
00104 nnfwString msg;
00105 };
00106 bool linePending;
00107 msgLine* pending;
00108 };
00109
00112 class NNFW_API nWarning : public nMessage {
00113 public:
00117 nMessage::msgLine operator<<( const nnfwString& part ) {
00118 nMessage::msgLine line(this);
00119 line.set( nnfwString("== WARNING: ").append(part) );
00120 return line;
00121 };
00123 };
00124
00127 class NNFW_API nError : public nMessage {
00128 public:
00132 nMessage::msgLine operator<<( const nnfwString& part ) {
00133 nMessage::msgLine line(this);
00134 line.set( nnfwString("== ERROR: ").append(part) );
00135 return line;
00136 };
00138 };
00139
00142 class NNFW_API nFatal : public nMessage {
00143 public:
00147 nMessage::msgLine operator<<( const nnfwString& part ) {
00148 nMessage::msgLine line(this);
00149 line.set( nnfwString("== FATAL: ").append(part) );
00150 return line;
00151 };
00153 };
00154
00155 }
00156
00157 #endif
00158
00159