~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/inc/Puma/CStrLiteral.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef __CStrLiteral_h__
20
20
#define __CStrLiteral_h__
21
21
 
 
22
/** \file
 
23
 *  String literal abstraction. */
 
24
 
22
25
#include "Puma/CExprValue.h"
23
26
 
24
27
namespace Puma {
25
28
 
26
29
 
 
30
/** \class CStrLiteral CStrLiteral.h Puma/CStrLiteral.h
 
31
 *  String literal abstraction. Holds the string value, 
 
32
 *  its length, and the string type. */
27
33
class CStrLiteral : public CExprValue {
28
34
  const char *_string;
29
35
  unsigned long _len;
30
36
  
31
37
public:
 
38
  /** Constructor.
 
39
   *  \param s The string array. 
 
40
   *  \param len The length of the string.
 
41
   *  \param t The type of the string. */
32
42
  CStrLiteral (const char *s, unsigned long len, CTypeInfo *t) : 
33
43
    CExprValue (t), _string (s), _len (len) {}
 
44
  /** Destructor. Frees the string. */
34
45
  virtual ~CStrLiteral () { if (_string) delete[] _string; }
35
46
 
 
47
  /** Print the string on the given output stream.
 
48
   *  \param out The output stream. */
36
49
  virtual void print (ostream &out) const { out << "\"" << String () << "\""; }
 
50
  /** Get the wide string. */
37
51
  const char *String () const { return _string; }
 
52
  /** Get the length of the string. */
38
53
  unsigned long Length () const { return _len; }
39
54
 
 
55
  /** Get this. */
40
56
  CStrLiteral *StrLiteral () const { return (CStrLiteral*)this; }
41
57
};
42
58