Back: FileDescriptor-testing Up: Base classes Forward: FileSegment class-basic   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.73 FileSegment

Defined in namespace Smalltalk
Superclass: Object
Category: Language-Implementation
My instances represent sections of files. I am primarily used by the compiler to record source code locations. I am not a part of the normal Smalltalk-80 kernel; I am specific to the GNU Smalltalk implementation.

1.73.1 FileSegment class: basic  (class)
1.73.2 FileSegment class: installing  (class)
1.73.3 FileSegment: basic  (instance)
1.73.4 FileSegment: equality  (instance)


1.73.1 FileSegment class: basic

on: aFile startingAt: startPos for: sizeInteger
Create a new FileSegment referring to the contents of the given file, from the startPos-th byte and for sizeInteger bytes


1.73.2 FileSegment class: installing

relocateFrom: startPath to: endPath
Remove startPath from all paths that start with it, and replace it with endPath. Needed to support $(DESTDIR) when installing


1.73.3 FileSegment: basic

asString
Answer a String containing the required segment of the file

copyFrom: from to: to
Answer a String containing the given subsegment of the file. As for streams, from and to are 0-based.

fileName
Answer the name of the file containing the segment

filePos
Answer the position in the file where the segment starts

relocateFrom: startPath to: endPath map: map
If the path starts with startPath, remove that part of the path and replace it with endPath. map is a Dictionary that is used so that equal filenames stay equal, without increasing the amount of memory that the image uses.

size
Answer the length of the segment

withFileDo: aBlock
Evaluate aBlock passing it the FileStream in which the segment identified by the receiver is stored


1.73.4 FileSegment: equality

= aFileSegment
Answer whether the receiver and aFileSegment are equal.

hash
Answer an hash value for the receiver.



Back: FileSegment-basic Up: FileSegment Forward: FileStream   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on May, 22 2008 using texi2html