Class: Wiris::StringBuf
- Inherits:
-
Object
- Object
- Wiris::StringBuf
- Defined in:
- lib/src-generic/StringBuf.rb
Instance Method Summary collapse
- #add(o) ⇒ Object
- #addChar(c) ⇒ Object
-
#initialize ⇒ StringBuf
constructor
A new instance of StringBuf.
- #sb ⇒ Object
- #to_s ⇒ Object
-
#toString ⇒ Object
public void addSub(String s, int pos, int len){ sb.append(s, pos, len+pos); }.
Constructor Details
#initialize ⇒ StringBuf
Returns a new instance of StringBuf.
11 12 13 |
# File 'lib/src-generic/StringBuf.rb', line 11 def initialize() @sb = StringIO.new('',"a+") # Append mode end |
Instance Method Details
#add(o) ⇒ Object
15 16 17 |
# File 'lib/src-generic/StringBuf.rb', line 15 def add(o) @sb << o end |
#addChar(c) ⇒ Object
19 20 21 |
# File 'lib/src-generic/StringBuf.rb', line 19 def addChar(c) @sb << c.chr end |
#sb ⇒ Object
7 8 9 |
# File 'lib/src-generic/StringBuf.rb', line 7 def sb @sb end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/src-generic/StringBuf.rb', line 31 def to_s() return @sb.string end |
#toString ⇒ Object
public void addSub(String s, int pos, int len)
sb.append(s, pos, len+pos);
27 28 29 |
# File 'lib/src-generic/StringBuf.rb', line 27 def toString() return @sb.string end |