 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
hitech_guy Guest
|
Posted: Sat Apr 23, 2005 2:25 am Post subject: C++ , Ostream derived |
|
|
Hi,
I am creating my own class derving from ostream. I am facing problem in
compiling with GNU G++ compiler under linux
class IWCoreEXPORT IWAFTraceLine : public ostream
{
public:
IWAFTraceLine( const char* pszFileName = 0,int
nLine = 0, const char* pszLayer = 0,int nError = -1 );
~IWAFTraceLine( );
IWAFTraceLine( const IWAFTraceLine& that );
IWAFTraceLine& operator = ( const IWAFTraceLine& that );
ostream buffer;
//!!! These numbers can't be negative, so why not uint or size_t?
int getErrorNumber( ) const;
void setErrorNumber( int nError );
int getLineNumber( ) const;
void setLineNumber( int nLine );
const String& getFileName( ) const;
void setFileName( const String& strFileName );
const String& getLayer( ) const;
void setLayer( const String& strLayer );
String getMessage( ) const;
Boolean existsSubstInfo( const String& key ) const;
const String& findSubstInfo( const String& key ) const;
void insertSubstInfo( const String& key,
const String& value );
private:
typedef map< String, String, less < String > ,allocator<String>
private:
String m_strFileName;
int m_nLine;
int m_nError;
String m_strLayer;
SubstInfoMap m_substInfo;
strstreambuf m_msg;
};
//!!! Should this be nested within IWAFException??
typedef vector< IWAFTraceLine ,allocator
IWAFTraceLines;
/********************************************************/
IWAFTraceLine::IWAFTraceLine( const char* pszFileName, int nLine,
const char* pszLayer,int nError) : m_strFileName.c_str(),
m_nLine,m_strLayer.c_str(),m_nError
{
if(pszFileName)
m_strFileName = pszFileName;
if(pszLayer)
m_strLayer = pszLayer;
init(&m_msg);
}
Can you please tell me that why the code is not been compiled in the
Linux with GNU G++ compiler.
mail me at [email]dinesh_tripathi (AT) hitechclub (DOT) com[/email]
regards
dinesh
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Ron Natalie Guest
|
Posted: Sun Apr 24, 2005 9:22 am Post subject: Re: C++ , Ostream derived |
|
|
hitech_guy wrote:
| Quote: | Hi,
I am creating my own class derving from ostream. I am facing problem in
compiling with GNU G++ compiler under linux
As I pointed out the last time you posted this, your code seems to |
assume that you can copy and assign ostreams, which you can't.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|