Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
pindent.StringReader Class Reference

List of all members.

Public Member Functions

def __init__
def read
def readline
def readlines

Public Attributes

 buf
 pos
 len

Detailed Description

Definition at line 355 of file pindent.py.


Constructor & Destructor Documentation

def pindent.StringReader.__init__ (   self,
  buf 
)

Definition at line 356 of file pindent.py.

00356 
00357     def __init__(self, buf):
00358         self.buf = buf
00359         self.pos = 0
        self.len = len(self.buf)

Member Function Documentation

def pindent.StringReader.read (   self,
  n = 0 
)

Definition at line 361 of file pindent.py.

00361 
00362     def read(self, n = 0):
00363         if n <= 0:
00364             n = self.len - self.pos
00365         else:
00366             n = min(n, self.len - self.pos)
00367         # end if
00368         r = self.buf[self.pos : self.pos + n]
00369         self.pos = self.pos + n
        return r

Here is the caller graph for this function:

Definition at line 371 of file pindent.py.

00371 
00372     def readline(self):
00373         i = self.buf.find('\n', self.pos)
        return self.read(i + 1 - self.pos)

Here is the caller graph for this function:

Definition at line 375 of file pindent.py.

00375 
00376     def readlines(self):
00377         lines = []
00378         line = self.readline()
00379         while line:
00380             lines.append(line)
00381             line = self.readline()
00382         # end while
        return lines

Here is the call graph for this function:


Member Data Documentation

Definition at line 357 of file pindent.py.

Definition at line 359 of file pindent.py.

Definition at line 358 of file pindent.py.


The documentation for this class was generated from the following file: