GXSBF class¶
-
class
geosoft.gx.
GXSBF
¶ The SBF class provides a means of storing data in a file-type directory structure within a workspace, database or map. Each of these three objects contains its own SBF object, which may be accessed using the
geosoft.gx.GXSBF.h_get_sys()
,geosoft.gx.GXSBF.h_get_db()
andgeosoft.gx.GXSBF.h_get_map()
functions. To access data in a file, or create a new file in the SBF object, call the CreatSBF_BF function (see BF), which will return a BF object to use.-
create
((str)arg1, (int)arg2) → GXSBF:¶ Create a child SBF object inside an SBF.
Parameters: - arg1 (str) – directory name to open / create
- arg2 (int) – SBF_OPEN constants
Returns: SBF object, terminates if fails.
Return type: New in version 5.0.0.
-
create_obj_list
((GXLST)arg1, (int)arg2) → None:¶ Fills an LST with embedded storage names of an SBF.
Parameters: - arg1 (
geosoft.gx.GXLST
) – LST handle - arg2 (int) – SBF_TYPE constants
Returns: Nothing
Return type: None
New in version 5.0.7.
Note:
Function will populate an LST object with embedded files (SBF_TYPE_FILES), directories (SBF_TYPE_DIRS), or both (pass SBF_TYPE_BOTH) in an SBF. Along with the Name of the file or directory, a constant "dir" or "file" string is written to the LST also.
- arg1 (
-
del_dir
((str)arg1) → None:¶ Delete a directory (storage) from this storage.
Parameters: arg1 (str) – Dir/Storage Name Returns: Nothing Return type: None New in version 5.0.0.
-
del_file
((str)arg1) → None:¶ Delete a file from this storage.
Parameters: arg1 (str) – File Name Returns: Nothing Return type: None New in version 5.0.0.
-
exist_dir
((str)arg1) → int:¶ Check to see if a directory (storage) exists inside this storage.
Parameters: arg1 (str) – Dir/Storage Name Returns: 0 - Does not exist 1 - Exists Return type: int New in version 5.0.0.
-
exist_file
((str)arg1) → int:¶ Check to see if a file exists inside this storage.
Parameters: arg1 (str) – File Name Returns: 0 - Does not exist 1 - Exists Return type: int New in version 5.0.0.
-
static
h_get_db
((GXContext)ctx, (GXDB)arg1) → GXSBF:¶ Get the embedded file storage from a database.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (
geosoft.gx.GXDB
) – Database
Returns: SBF Object
Return type: New in version 5.0.0.
- ctx (
-
static
h_get_map
((GXContext)ctx, (GXMAP)arg1) → GXSBF:¶ Get the embedded file storage from a map.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (
geosoft.gx.GXMAP
) – MAP object
Returns: SBF Object
Return type: New in version 5.0.0.
- ctx (
-
static
h_get_sys
((GXContext)ctx) → GXSBF:¶ Get the main embedded file storage (in workspace).
Parameters: ctx ( geosoft.gx.GXContext
) – The GX execution contextReturns: SBF Object Return type: geosoft.gx.GXSBF
New in version 5.0.0.
-
is_null
() → bool¶ Check if the instance of
geosoft.gx.GXSBF is null (undefined)
Returns: True if this is a null instance of geosoft.gx.GXSBF
, False otherwise.Return type: bool`
-
static
null
() → GXSBF¶ A null (undefined) instance of
geosoft.gx.GXSBF
Returns: A null geosoft.gx.GXSBF
Return type: geosoft.gx.GXSBF
-
save_log
((str)arg1, (str)arg2, (str)arg3, (int)arg4) → None:¶ Save an embedded file to an ASCII file.
Parameters: - arg1 (str) – Directory name in the Parent SBF
- arg2 (str) – File name in the directory
- arg3 (str) – File to save as (as an ASCII file)
- arg4 (int) – Append Mode: 0 - New file, 1 - Append file
Returns: Nothing
Return type: None
New in version 5.0.0.
-