OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [language/] [cxx/] [ustl/] [current/] [src/] [ustdxept.cpp] - Blame information for rev 845

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// This file is part of the uSTL library, an STL implementation.
2
//
3
// Copyright (c) 2005-2009 by Mike Sharov <msharov@users.sourceforge.net>
4
// This file is free software, distributed under the MIT License.
5
 
6
#include "ustdxept.h"
7
#include "mistream.h"
8
#include "mostream.h"
9
#include "strmsize.h"
10
#include "uiosfunc.h"
11
#include "uspecial.h"
12
 
13
namespace ustl {
14
 
15
//----------------------------------------------------------------------
16
 
17
/// \p arg contains a description of the error.
18
error_message::error_message (const char* arg) throw()
19
: m_Arg ()
20
{
21
    USTL_TRY { m_Arg = arg; } USTL_CATCH_ALL
22
    set_format (xfmt_ErrorMessage);
23
}
24
 
25
/// Virtual destructor
26
error_message::~error_message (void) throw()
27
{
28
}
29
 
30
/// Returns a descriptive error message. fmt="%s: %s"
31
void error_message::info (string& msgbuf, const char* fmt) const throw()
32
{
33
    if (!fmt) fmt = "%s: %s";
34
    USTL_TRY { msgbuf.format (fmt, name(), m_Arg.cdata()); } USTL_CATCH_ALL
35
}
36
 
37
/// Reads the object from stream \p is.
38
void error_message::read (istream& is)
39
{
40
    exception::read (is);
41
    is >> m_Arg >> ios::align();
42
}
43
 
44
/// Writes the object to stream \p os.
45
void error_message::write (ostream& os) const
46
{
47
    exception::write (os);
48
    os << m_Arg << ios::align();
49
}
50
 
51
/// Returns the size of the written object.
52
size_t error_message::stream_size (void) const
53
{
54
    return (exception::stream_size() + Align (stream_size_of (m_Arg)));
55
}
56
 
57
} // namespace ustl

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.