Bullet(int f = -1, int c = -1, int s = -1);
///
- Bullet(string const &);
+ explicit Bullet(string const &);
///
void setCharacter(int);
///
int getSize() const;
///
- string getText() const;
+ string const & getText() const;
///
- string getText();
- ///
- char const * c_str();
- ///
- Bullet & operator = (Bullet const &);
+ Bullet & operator=(Bullet const &);
///
friend bool operator==(Bullet const &, Bullet const &);
- ///
- friend bool operator!=(Bullet const & b1, Bullet const & b2) {
- return !(b1 == b2);
- }
protected:
#ifdef ENABLE_ASSERTIONS
+ ///
void testInvariant() const {
Assert(font >= MIN);
Assert(font < FONTMAX);
};
///
- void generateText();
+ void generateText() const;
///
- static string bulletSize(short int);
+ static string const bulletSize(short int);
///
- static string bulletEntry(short int, short int);
+ static string const bulletEntry(short int, short int);
///
- short font;
+ int font;
///
- short character;
+ int character;
///
- short size;
+ int size;
// size, character and font are array indices to access
// the predefined arrays of LaTeX equivalent strings.
or if I can use it to generate strings (0)
or have already (-1)
*/
- short user_text;
+ mutable short user_text;
//NOTE: Arranging these four shorts above to be together
// like this should ensure they are in a single cache line
or one generated internally from the font, character
and size settings.
*/
- string text;
+ mutable string text;
};
/*----------------Inline Bullet Member Functions------------------*/
-inline Bullet::Bullet(string const & t)
+inline
+Bullet::Bullet(string const & t)
: font(MIN), character(MIN), size(MIN), user_text(1), text(t)
{
#ifdef ENABLE_ASSERTIONS
}
-inline void Bullet::setCharacter(int c)
+inline
+void Bullet::setCharacter(int c)
{
if (c < MIN || c >= CHARMAX) {
character = MIN;
}
-inline void Bullet::setFont(int f)
+inline
+void Bullet::setFont(int f)
{
if (f < MIN || f >= FONTMAX) {
font = MIN;
}
-inline void Bullet::setSize(int s)
+inline
+void Bullet::setSize(int s)
{
if (s < MIN || s >= SIZEMAX) {
size = MIN;
}
-inline void Bullet::setText(string const & t)
+inline
+void Bullet::setText(string const & t)
{
font = character = size = MIN;
user_text = 1;
}
-inline int Bullet::getCharacter() const
+inline
+int Bullet::getCharacter() const
{
return character;
}
-inline int Bullet::getFont() const
+inline
+int Bullet::getFont() const
{
return font;
}
-inline int Bullet::getSize() const
+inline
+int Bullet::getSize() const
{
return size;
}
-inline string Bullet::getText() const
-{
- return text;
-}
-
-
-inline Bullet & Bullet::operator=(Bullet const & b)
+inline
+Bullet & Bullet::operator=(Bullet const & b)
{
#ifdef ENABLE_ASSERTIONS
b.testInvariant();
return *this;
}
+/*-----------------End Bullet Member Functions-----------------*/
-inline char const * Bullet::c_str()
+inline
+bool operator!=(Bullet const & b1, Bullet const & b2)
{
- return this->getText().c_str();
+ return !(b1 == b2);
}
-
-/*-----------------End Bullet Member Functions-----------------*/
-
+///
extern
Bullet const ITEMIZE_DEFAULTS[];