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 String
DIR
static int
DIR_TYPE
static String
FILE_WRITE_CONTENT_KEY
static String
FILE_WRITE_PATH_KEY
static String
FILE_WRITE_TYPE_KEY
static String
INI_LIST_ENTRY_START
static int
IO_FUNCTION_BASE_VALUE
static String
IO_NAMESPACE
static String
MKDIR
static int
MKDIR_TYPE
static String
READ_FILE
static int
READ_FILE_TYPE
static String
RM_FILE
static int
RM_FILE_TYPE
static String
RMDIR
static int
RMDIR_TYPE
static String
SCAN_FUNCTION
static int
SCAN_TYPE
static String
VFS_MOUNT
static int
VFS_MOUNT_TYPE
static String
VFS_UNMOUNT
static int
VFS_UNMOUNT_TYPE
static String
WRITE_FILE
static int
WRITE_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 void
convertToIni(List<String> names, QDLStem stem, StringBuilder sb, String initialIndent, int indentFactor, boolean allowListEntries)
static String
convertToIni(QDLStem obj2, boolean allowListEntries)
static String
convertToIni(QDLStem obj2, int indentFactor, boolean allowListEntries)
static String
convertToIniOLD(QDLStem obj2)
boolean
dispatch(Polyad polyad, State state)
Does the actual evaluation of thePolyad
.protected void
doDir(Polyad polyad, State state)
Quick note.protected void
doMkDir(Polyad polyad, State state)
protected void
doReadFile(Polyad polyad, State state)
protected void
doRMDir(Polyad polyad, State state)
protected void
doRMFile(Polyad polyad, State state)
protected void
doScan(Polyad polyad, State state)
protected void
doWriteFile(Polyad polyad, State state)
String[]
getFunctionNames()
String
getNamespace()
int
getType(String name)
protected QDLStem
processWriteFileStem(QDLStem input, State state, Polyad polyad)
protected QDLStem
readFileStem(QDLStem input, QDLStem types, Long defaultType, State state, Polyad polyad)
protected Object
readSingleFile(String fileName, Long type, State state, Polyad polyad)
protected static String
toIniList(QDLList list)
protected static String
toSectionHeader(List<String> names)
protected void
vfsMount(Polyad polyad, State state)
protected void
vfsUnmount(Polyad polyad, State state)
protected void
writeSingleFile(String fileName, Object 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, 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:
getFunctionNames
in classAbstractEvaluator
-
getType
public int getType(String name)
-
dispatch
public boolean dispatch(Polyad polyad, State state)
Description copied from class:AbstractEvaluator
Does the actual evaluation of thePolyad
.- Specified by:
dispatch
in 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, Object 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)
-
-