Package org.qdl_lang.evaluate
Class IOEvaluator
- java.lang.Object
-
- org.qdl_lang.evaluate.AbstractEvaluator
-
- org.qdl_lang.evaluate.IOEvaluator
-
- All Implemented Interfaces:
Serializable,EvaluatorInterface
public class IOEvaluator extends AbstractEvaluator
Created by Jeff Gaynor
on 1/16/20 at 9:18 AM- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.qdl_lang.evaluate.AbstractEvaluator
AbstractEvaluator.CommonKeyIterator, AbstractEvaluator.fPointer, AbstractEvaluator.fpResult
-
-
Field Summary
Fields Modifier and Type Field Description static StringDIRstatic intDIR_TYPEstatic StringFILE_WRITE_CONTENT_KEYstatic StringFILE_WRITE_PATH_KEYstatic StringFILE_WRITE_TYPE_KEYstatic StringINI_LIST_ENTRY_STARTstatic intIO_FUNCTION_BASE_VALUEstatic StringIO_NAMESPACEstatic StringMKDIRstatic intMKDIR_TYPEstatic StringREAD_FILEstatic intREAD_FILE_TYPEstatic StringRM_FILEstatic intRM_FILE_TYPEstatic StringRMDIRstatic intRMDIR_TYPEstatic StringSCAN_FUNCTIONstatic intSCAN_TYPEstatic StringVFS_MOUNTstatic intVFS_MOUNT_TYPEstatic StringVFS_UNMOUNTstatic intVFS_UNMOUNT_TYPEstatic StringWRITE_FILEstatic intWRITE_FILE_TYPE-
Fields inherited from class org.qdl_lang.evaluate.AbstractEvaluator
bigArgList, bigArgList0, FILE_OP_AUTO, FILE_OP_BINARY, FILE_OP_INPUT_STREAM, FILE_OP_TEXT_INI, FILE_OP_TEXT_STEM, FILE_OP_TEXT_STRING, FILE_OP_TEXT_WITHOUT_LIST_INI, fNames, MAX_ARG_COUNT
-
Fields inherited from interface org.qdl_lang.evaluate.EvaluatorInterface
UNKNOWN_VALUE
-
-
Constructor Summary
Constructors Constructor Description IOEvaluator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidconvertToIni(List<String> names, QDLStem stem, StringBuilder sb, String initialIndent, int indentFactor, boolean allowListEntries)static StringconvertToIni(QDLStem obj2, boolean allowListEntries)static StringconvertToIni(QDLStem obj2, int indentFactor, boolean allowListEntries)booleandispatch(Polyad polyad, State state)Does the actual evaluation of thePolyad.protected voiddoDir(Polyad polyad, State state)Quick note.protected voiddoMkDir(Polyad polyad, State state)protected voiddoReadFile(Polyad polyad, State state)protected voiddoRMDir(Polyad polyad, State state)protected voiddoRMFile(Polyad polyad, State state)protected voiddoScan(Polyad polyad, State state)protected voiddoWriteFile(Polyad polyad, State state)String[]getFunctionNames()StringgetNamespace()intgetType(String name)protected QDLStemprocessWriteFileStem(QDLStem input, State state, Polyad polyad)protected QDLStemreadFileStem(QDLStem input, QDLStem types, Long defaultType, State state, Polyad polyad)protected ObjectreadSingleFile(String fileName, Long type, State state, Polyad polyad)protected static StringtoIniList(QDLList<? extends QDLValue> list)protected static StringtoSectionHeader(List<String> names)protected voidvfsMount(Polyad polyad, State state)protected voidvfsUnmount(Polyad polyad, State state)protected voidwriteSingleFile(String fileName, QDLValue content, int fileType, State state, Polyad polyad)-
Methods inherited from class org.qdl_lang.evaluate.AbstractEvaluator
areAllBigDecimals, areAllBoolean, areAllLongs, areAllNumbers, areAllSets, areAllStems, areAllStrings, areAnyBigDecimals, areNoneStems, bdEquals, checkNull, checkNull, convertArgsToStem, evaluate, evaluate, finishExpr, getBigArgList, getBigArgList0, getCommonKeys, getFQFunctionNames, getFunctionReferenceNode, getFunctionReferenceNode, getOperator, getOrCreateStem, isBigDecimal, isBoolean, isBuiltInFunction, isFunctionRef, isLong, isNumber, isScalar, isSet, isStem, isStemList, isString, listFunctions, NEWgetOperator, OLDgetOperator, process1, process2, process2, process3, processSet1, processSet2, processSet2, processStem1, processStem2, processStem3, resolveResourceToFile, tempFname, toBD, toConstants, toStem
-
-
-
-
Field Detail
-
IO_NAMESPACE
public static final String IO_NAMESPACE
- See Also:
- Constant Field Values
-
IO_FUNCTION_BASE_VALUE
public static final int IO_FUNCTION_BASE_VALUE
- See Also:
- Constant Field Values
-
SCAN_FUNCTION
public static final String SCAN_FUNCTION
- See Also:
- Constant Field Values
-
SCAN_TYPE
public static final int SCAN_TYPE
- See Also:
- Constant Field Values
-
READ_FILE
public static final String READ_FILE
- See Also:
- Constant Field Values
-
READ_FILE_TYPE
public static final int READ_FILE_TYPE
- See Also:
- Constant Field Values
-
WRITE_FILE
public static final String WRITE_FILE
- See Also:
- Constant Field Values
-
WRITE_FILE_TYPE
public static final int WRITE_FILE_TYPE
- See Also:
- Constant Field Values
-
DIR
public static final String DIR
- See Also:
- Constant Field Values
-
DIR_TYPE
public static final int DIR_TYPE
- See Also:
- Constant Field Values
-
MKDIR
public static final String MKDIR
- See Also:
- Constant Field Values
-
MKDIR_TYPE
public static final int MKDIR_TYPE
- See Also:
- Constant Field Values
-
RMDIR
public static final String RMDIR
- See Also:
- Constant Field Values
-
RMDIR_TYPE
public static final int RMDIR_TYPE
- See Also:
- Constant Field Values
-
RM_FILE
public static final String RM_FILE
- See Also:
- Constant Field Values
-
RM_FILE_TYPE
public static final int RM_FILE_TYPE
- See Also:
- Constant Field Values
-
VFS_MOUNT
public static final String VFS_MOUNT
- See Also:
- Constant Field Values
-
VFS_MOUNT_TYPE
public static final int VFS_MOUNT_TYPE
- See Also:
- Constant Field Values
-
VFS_UNMOUNT
public static final String VFS_UNMOUNT
- See Also:
- Constant Field Values
-
VFS_UNMOUNT_TYPE
public static final int VFS_UNMOUNT_TYPE
- See Also:
- Constant Field Values
-
FILE_WRITE_PATH_KEY
public static final String FILE_WRITE_PATH_KEY
- See Also:
- Constant Field Values
-
FILE_WRITE_CONTENT_KEY
public static final String FILE_WRITE_CONTENT_KEY
- See Also:
- Constant Field Values
-
FILE_WRITE_TYPE_KEY
public static final String FILE_WRITE_TYPE_KEY
- See Also:
- Constant Field Values
-
INI_LIST_ENTRY_START
public static final String INI_LIST_ENTRY_START
- See Also:
- Constant Field Values
-
-
Method Detail
-
getNamespace
public String getNamespace()
-
getFunctionNames
public String[] getFunctionNames()
- Specified by:
getFunctionNamesin classAbstractEvaluator
-
getType
public int getType(String name)
-
dispatch
public boolean dispatch(Polyad polyad, State state)
Description copied from class:AbstractEvaluatorDoes the actual evaluation of thePolyad.- Specified by:
dispatchin classAbstractEvaluator- Returns:
-
doDir
protected void doDir(Polyad polyad, State state)
Quick note. This is a directory command. That means that it will list the things in a directory. This is not like, e.g., the unix ls command. The ls command lists information so
ls filename
returns the file name. This command returns what is in the directory. Sodir(filename)returns null since the name is not a directory.- Parameters:
polyad-state-
-
processWriteFileStem
protected QDLStem processWriteFileStem(QDLStem input, State state, Polyad polyad)
-
writeSingleFile
protected void writeSingleFile(String fileName, QDLValue content, int fileType, State state, Polyad polyad)
-
convertToIni
public static String convertToIni(QDLStem obj2, int indentFactor, boolean allowListEntries)
-
convertToIni
protected static void convertToIni(List<String> names, QDLStem stem, StringBuilder sb, String initialIndent, int indentFactor, boolean allowListEntries)
-
readFileStem
protected QDLStem readFileStem(QDLStem input, QDLStem types, Long defaultType, State state, Polyad polyad)
-
-