def __init__(self, r1: str) -> None: r2 = BufferedReader(r1) flag = False tmp = None while not flag: tmp = r2.read_line() if tmp == '': flag = True else: flag2 = True s1 = StringBuffer() s2 = StringBuffer() for i in range(len(tmp)): tmp2 = tmp[i] if flag2: if tmp2 == '=': flag2 = False else: s1.append(tmp2) else: s2.append(tmp2) ss1 = s1.to_string() ss2 = s2.to_string() self._map[ss1] = ss2
def _get_xml_writer(self): return xmlWriter.XMLWriter(stream=StringBuffer(self))
#! /usr/bin/env python # @program: Driver for StringBuffer # @author: A. De from string_buffer import StringBuffer buffer = StringBuffer() buffer.append('Apple') buffer.append('Mango') buffer.append('Orange') print buffer.toString()