~ubuntu-branches/ubuntu/raring/simutrans/raring-proposed

« back to all changes in this revision

Viewing changes to utils/cbuffer_t.h

  • Committer: Package Import Robot
  • Author(s): Ansgar Burchardt
  • Date: 2011-11-03 19:59:02 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20111103195902-uopgwf488mfctb75
Tags: 111.0-1
* New upstream release.
* debian/rules: Update get-orig-source target for new upstream release.
* Use xz compression for source and binary packages.
* Use override_* targets to simplify debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        int len() const { return size; }
33
33
 
34
34
        /**
35
 
         * if (is_full) then the buffer has to be extended to be able to receive more chars
36
 
         */
37
 
        bool is_full() const { return size >= (capacity-1); }
38
 
 
39
 
        /**
40
35
         * Creates a new cbuffer with capacity cap
41
36
         * @param cap the capacity
42
37
         * @author Hj. Malthaner
43
38
         */
44
 
        cbuffer_t(unsigned int size);
 
39
        cbuffer_t();
45
40
        ~cbuffer_t();
46
41
 
47
42
 
53
48
 
54
49
 
55
50
        /**
56
 
         * Appends text. If buffer is full, exceeding text will not
57
 
         * be appended.
 
51
         * Appends text. Buffer will be extended if it does not have enough capacity.
58
52
         * @author Hj. Malthaner
59
53
         */
60
54
        void append(const char * text);
61
55
 
62
56
        /**
63
 
         * Appends a number. If buffer is full, exceeding digits will not
64
 
         * be appended.
65
 
         * @author Hj. Malthaner
66
 
         */
67
 
        void append(long n);
68
 
 
69
 
        /**
70
 
         * Appends a number. If buffer is full, exceeding digits will not
71
 
         * be appended.
 
57
         * Appends a number. Buffer will be extended if it does not have enough capacity.
72
58
         * @author Hj. Malthaner
73
59
         */
74
60
        void append(double n, int precision);
77
63
        void printf(const char* fmt, ...);
78
64
 
79
65
        /* enlarge the buffer if needed (i.e. size+by_amount larger than capacity) */
80
 
        void extend( const unsigned int by_amount );
 
66
        void extend(unsigned int by_amount);
81
67
 
82
68
        /**
83
69
         * Automagic conversion to a const char* for backwards compatibility