Class: Wiris::StringBuf

Inherits:
Object
  • Object
show all
Defined in:
lib/src-generic/StringBuf.rb

Instance Method Summary collapse

Constructor Details

#initializeStringBuf

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

#sbObject



7
8
9
# File 'lib/src-generic/StringBuf.rb', line 7

def sb
  @sb
end

#to_sObject



31
32
33
# File 'lib/src-generic/StringBuf.rb', line 31

def to_s()
  return @sb.string
end

#toStringObject

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