File_Therion |
[ class tree: File_Therion ] [ index: File_Therion ] [ all elements ] |
Packages: File_Therion File_Therion_DataTypes File_Therion_Formatters File_Therion_Readers File_Therion_Writers Classes:
File_Therion
Files:File_Therion_BasicObject File_Therion_Centreline File_Therion_Exception File_Therion_Grade File_Therion_InvalidReferenceException File_Therion_IOException File_Therion_Join File_Therion_Line File_Therion_Map File_Therion_Scrap File_Therion_ScrapArea File_Therion_ScrapLine File_Therion_ScrapLinePoint File_Therion_ScrapPoint File_Therion_Shot File_Therion_Station File_Therion_Surface File_Therion_Survey File_Therion_SyntaxException
BasicObject.abstract.php
Centreline.php Exception.php Grade.php Join.php Line.php Map.php Scrap.php ScrapArea.php ScrapLine.php ScrapPoint.php Shot.php Station.php Surface.php Survey.php Therion.php |
[ Top ] Method Detail__construct (Constructor) [line 229]
Create a new therion file object representing content at $filename. Use this to create a new interface for parsing existing files or writing new ones. The $filename tells the physical file name of the file. Use fetch() if you want to read the source contents or write() to write the current content to the target. Example:
Parameters:
[ Top ]
addFormatter [line 1470]
Add a formatter. The formatters will be called in the order they were added.
Parameters:
[ Top ]
addLine [line 514]
Add a line to this file. The optional index parameter allows to adjust the insertion point; the line will be inserted at the index, pushing already present content one line down (-1=end, 0=start, ...). When replacing, the selected index will be replaced. Instead of $index 0 and -1 you can use the strings 'start'/'end', this will make your code more readable. Using Beware that clearLines() will discard any manual insertions. Also be aware that fetch() will clean the line buffer too. Note that addLine() will not take care of wrapping; make sure that the line content remains consistent. Be sure to use the correct encoding for your data (-> setEncoding() and encode() for more details). Example: Instead of Line objects you may also add a string as $line argument. In this case a new Line object will be parsed for you. Right spaces and newline will be trimmed. Note that the lines content is expected to be already encoded in the current files encoding. If the codesets differ, encode them first. See encode() for encoding or use phps own functions.
Parameters:
[ Top ]
addObject [line 728]
Add an File_Therion data model object to this file Associated objects can be written to a file after updateLines() has been called to update the internal line representation. Be aware that clearObjects() will discard any manual changes made so far, and be warned that updateObjects() will clean them too.
Parameters:
[ Top ]
checkSyntax [line 1139]
Check basic syntax of internal line buffer This validates basic syntax of internal file buffer. The following checks will be performed:
[ Top ]
clearFormatters [line 1491]
Remove all formatters.
Parameters:[ Top ]
clearLines [line 699]
Clear associated lines. This will wipe out the internal line buffer.
[ Top ]
clearObjects [line 711]
Clear associated objects. This will unassociate all registered objects. You probably want to call clearLines() hereafter to also clean the calculated line content.
[ Top ]
count [line 1023]
Count (wrapped) lines in this file (SPL Countable). returns the count of physical (ie. wrapped) lines in this file. To count logical lines (ie. unwrapped, or line objects), use $logical.
Parameters:
[ Top ]
encode [line 1092]
Encode data. Will check if target-encoding is supported by therion. If $strictCheck is set to TRUE, the from encoding will also be verified against supported therion encodings. Use this in case the source encoding is a known therion file.
Parameters:
[ Top ]
evalInputCMD [line 1184]
Scan local filebuffer for 'input' commands and execute them. Therions 'input' statement will include the remote file content at the place of the 'input <filename>' therion command. This will try to interpret the given filepath in local context; the input-parameter is always a filepath in a filesystem. When the filename has no extension, ".th" is assumed. For actually fetching the content, the currently associated File_Therion_Reader implementation will be used (see setReader()). With the default FileReader this means that we will assume the filename to be relative to the local file on a local mounted disk. Please note that referenced files will be converted to the parent file encoding (all 'input' content is encoded to this files codeset). To limit the number of possible nested levels you may specify the $lvls parameter:
Parameters:
[ Top ]
extractMultilineCMD [line 1350]
Build structure of local-scope multiline commands with associated lines. This will order the lines passed into a nested array sorting the lines belonging together into subarrays collected under a common tag. The first level contains all "seen" tags like surveys. There all survey lines will be collected and ordered into their own array. The special 'LOCAL' array kay holds all lines that where not enclosed into their own contect and are therefore considered "local". Nested structures (like they are ancountered with surveys) need to be resolved with consecutive calls to this method. The structure holds all the lines of the first levels, so eg. in case of nested structures there will be all lines of the outermost survey command The structure will look like this:
Parameters:
[ Top ]
fetch [line 413]
Update the internal line representation of this file from datasource. This will use the supplied Reader to fetch therion file content. If no Reader was supplied (NULL/missing value), the internal default reader will be used (File_Therion_FileReader). The supplied reader will be also used for subsequent reads, like when resolving input commands. Be aware that the Reader usually clears the internal line buffer, so any changes made by addLine() get discarded. Please refer to the readers documentation if you want to avoid this. After fetching physical content, you may call updateObjects() to generate Therion data model objects out of it. (Some Reader implementeations may already do this for you!)
Parameters:
[ Top ]
format [line 1502]
Format lines using registered formatters.
Parameters:
[ Top ]
getAllObjects [line 796]
Get all associated objects of this file. Example:
[ Top ]
getCentrelines [line 830]
Get all directly associated centrelines of this file. Note that this kind of object is usually not "lone" in a file but commonly part of a survey. This function returns only "lone" objects without parent structure. Example:
[ Top ]
getEncoding [line 1070]
Get encoding of input/output files currently active.
[ Top ]
getFilename [line 976]
Get physical file name of this file object.
Parameters:
[ Top ]
getHeader [line 1009]getLines [line 665]
Get internal line buffer. The lines will be formatted using the registered formatters (see addFormatter()). On each consecutive run of getLines() the formatters will be reapplied. This may yield strange results. If you want to format just once, {link removeFormatters()} after formatting was applied.
[ Top ]
getMaps [line 868]
Get all directly associated Maps of this file. Note that this kind of object is usually not "lone" in a file but commonly part of a survey. This function returns only "lone" objects without parent structure. Example:
[ Top ]
getObjects [line 750]
Get all associated objects of this file. You can optionaly query for specific types using $filter. You may ommit the prefix 'File_Therion_' from the filter. Example:
Parameters:
[ Top ]
getScraps [line 849]
Get all directly associated Scraps of this file. Note that this kind of object is usually not "lone" in a file but commonly part of a survey. This function returns only "lone" objects without parent structure. Example:
[ Top ]
getSurfaces [line 887]
Get all directly associated Surface definitions of this file. Note that this kind of object is usually not "lone" in a file but commonly part of a survey. This function returns only "lone" objects without parent structure. Example:
[ Top ]
getSurveys [line 811]
Get all directly associated surveys of this file. Example:
[ Top ]
getVersion [line 201]
Returns the current release version, may be called statically
[ Top ]
handleEncodingLine [line 634]
Handle 'encoding' command in internal line buffer.
[ Top ]
parse [line 265]
Parse datasource into objects. This will perform the following operations:
To limit the number of possible nested levels you may specify the $recurse parameter (null=default: endless, 0: none, >0: nested levels). Please read also the documentation of fetch(), evalInputCMD() and updateObjects() for informations on their respective capabilitys and pitfalls.
Parameters:
[ Top ]
setEncoding [line 1054]
Set encoding of input/output files. This will tell what encoding to use. This method only signals which encoding the data should be in and will not actively change encoding. Make sure your data matches the encoding given! Only a small subset of PHP encoding names are supported by therion, see $_supportedEncodings for a list. When NULL is given, the current encoding will be reset to "unknown".
Parameters:
[ Top ]
setFilename [line 959]
Set filename of this file object. This will just change the path, no data will be read/written!
Parameters:
[ Top ]
setHeader [line 999]
Set header string, that will be printed to generated files.
Parameters:
[ Top ]
setReader [line 387]
Set default reader that is used to fetch file content.
Parameters:
[ Top ]
toString [line 933]
Get file lines as string. Returns the file line content as string, suitable for writing using PHPs fwrite(). The actual content can optionally be formatted by adding File_Therion_Formatter instances with addFormatter(). This can influence line endings and wrapping for instance. By default, the line ending used is depending on the current PHP_EOL constant. No wrapping will occur, unless the internal lines have such wrapping.
[ Top ]
updateLines [line 436]
Update the internal line representation of this file from contained objects. This will generate therion file lines out of the associated objects. Be aware that this will clear already existing line content!
[ Top ]
updateObjects [line 290]
Parses the internal line buffer to associated Therion objects. You may use fetch() to update the internal line buffer with real physical content from the datasource. Alternatively you can craft the file yourself using addLine(). Be aware that this function cleans all references to associated objects.
[ Top ]
write [line 904]
Write this therion file content to the file. The writing will be carried out by the supplied writer object. If no writer was supplied, a new DirectWriter will be instantiated as default.
Parameters:
[ Top ]
_getEncodingName [line 1117]
Get internal (PHP compatible) name of encoding name.
Parameters:
[ Top ]
__toString [line 946]Documentation generated on Mon, 11 Mar 2019 15:09:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004. |