~ubuntu-branches/ubuntu/oneiric/squid3/oneiric-security

« back to all changes in this revision

Viewing changes to lib/cppunit-1.10.0/src/cppunit/Message.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2007-05-13 16:03:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070513160316-2h6kn6h1z0q1fvyo
Tags: 3.0.PRE6-1
* New upstream release
  - Removed patches integrated upsteam:
    + 04-m68k-ftbfs

* debian/rules
  - Enable delay pools (Closes: #410785)
  - Enable cache digests (Closes: #416631)
  - Enable ICAP client
  - Raised Max Filedescriptor limit to 65536

* debian/control
  - Added real package dependency for httpd in squid3-cgi

* debian/patches/02-makefile-defaults
  - Fix default configuration file for cachemgr.cgi (Closes: #416630)

* debian/squid3.postinst
  - Fixed bashish in postinst (Closes: #411797)

* debian/patches/05-helpers-typo
  - Added upstream patch fixing compilation error in src/helpers.cc

* debian/patches/06-mem-obj-reference
  - Added upstream patch fixing a mem_obj reference in src/store.cc

* debian/patches/07-close-icap-connections
  - Added upstream patch fixing icap connection starvation

* debian/squid3.rc
  - Added LSB-compliant description to rc script

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <cppunit/Message.h>
2
 
#include <stdexcept>
3
 
 
4
 
 
5
 
CPPUNIT_NS_BEGIN
6
 
 
7
 
 
8
 
Message::Message()
9
 
{
10
 
}
11
 
 
12
 
 
13
 
Message::Message( const std::string &shortDescription )
14
 
    : m_shortDescription( shortDescription )
15
 
{
16
 
}
17
 
 
18
 
 
19
 
Message::Message( const std::string &shortDescription,
20
 
                  const std::string &detail1 )
21
 
    : m_shortDescription( shortDescription )
22
 
{
23
 
  addDetail( detail1 );
24
 
}
25
 
 
26
 
 
27
 
Message::Message( const std::string &shortDescription,
28
 
                  const std::string &detail1,
29
 
                  const std::string &detail2 )
30
 
    : m_shortDescription( shortDescription )
31
 
{
32
 
  addDetail( detail1, detail2 );
33
 
}
34
 
 
35
 
 
36
 
Message::Message( const std::string &shortDescription,
37
 
                  const std::string &detail1,
38
 
                  const std::string &detail2,
39
 
                  const std::string &detail3 )
40
 
    : m_shortDescription( shortDescription )
41
 
{
42
 
  addDetail( detail1, detail2, detail3 );
43
 
}
44
 
 
45
 
 
46
 
const std::string &
47
 
Message::shortDescription() const
48
 
{
49
 
  return m_shortDescription;
50
 
}
51
 
 
52
 
 
53
 
int 
54
 
Message::detailCount() const
55
 
{
56
 
  return m_details.size();
57
 
}
58
 
 
59
 
 
60
 
std::string 
61
 
Message::detailAt( int index ) const
62
 
{
63
 
  if ( index < 0  ||  index >= detailCount() )
64
 
    throw std::invalid_argument( "Message::detailAt() : invalid index" );
65
 
 
66
 
  return m_details[ index ];
67
 
}
68
 
 
69
 
 
70
 
std::string 
71
 
Message::details() const
72
 
{
73
 
  std::string details;
74
 
  for ( Details::const_iterator it = m_details.begin(); it != m_details.end(); ++it )
75
 
  {
76
 
    details += "- ";
77
 
    details += *it;
78
 
    details += '\n';
79
 
  }
80
 
  return details;
81
 
}
82
 
 
83
 
 
84
 
void 
85
 
Message::clearDetails()
86
 
{
87
 
  m_details.clear();
88
 
}
89
 
 
90
 
 
91
 
void 
92
 
Message::addDetail( const std::string &detail )
93
 
{
94
 
  m_details.push_back( detail );
95
 
}
96
 
 
97
 
 
98
 
void 
99
 
Message::addDetail( const std::string &detail1,
100
 
                    const std::string &detail2 )
101
 
{
102
 
  addDetail( detail1 );
103
 
  addDetail( detail2 );
104
 
}
105
 
 
106
 
 
107
 
void 
108
 
Message::addDetail( const std::string &detail1,
109
 
                    const std::string &detail2,
110
 
                    const std::string &detail3 )
111
 
{
112
 
  addDetail( detail1, detail2 );
113
 
  addDetail( detail3 );
114
 
}
115
 
 
116
 
 
117
 
void 
118
 
Message::addDetail( const Message &message )
119
 
{
120
 
  m_details.insert( m_details.end(), 
121
 
                    message.m_details.begin(), 
122
 
                    message.m_details.end() );
123
 
}
124
 
 
125
 
 
126
 
void 
127
 
Message::setShortDescription( const std::string &shortDescription )
128
 
{
129
 
  m_shortDescription = shortDescription;
130
 
}
131
 
 
132
 
 
133
 
bool 
134
 
Message::operator ==( const Message &other ) const
135
 
{
136
 
  return m_shortDescription == other.m_shortDescription  &&
137
 
         m_details == other.m_details;
138
 
}
139
 
 
140
 
 
141
 
bool 
142
 
Message::operator !=( const Message &other ) const
143
 
{
144
 
  return !( *this == other );
145
 
}
146
 
 
147
 
 
148
 
CPPUNIT_NS_END
149