henc · Chart File I/O
ENC / SENC / catalog / shape file load / save / unload
hencLoad
Section titled “hencLoad”Prototype
Section titled “Prototype”int hencLoad( const char *fn, bool flagLoadUpdate = true )Function
Section titled “Function”- After loading the ENC cell file, convert it to SENC format.
- Load the ENC catalog files and then load multiple ENC files.
- Load the SENC files.
- After loading the SENC catalog file, convert it to SENC format and load it into memory.
- After loading the shape files, load multiple ENC files.
Parameters
Section titled “Parameters”const char *fn : IN (Filename to load)
Return Value
Section titled “Return Value”- = 0 : Success
- < 0 : Fail
hencLoadENCintoDom
Section titled “hencLoadENCintoDom”Prototype
Section titled “Prototype”int hencLoadENCintoDom( const char *fn, CDomNode *node )Function
Section titled “Function”- Load ENC files into memory in CDomNode format.
- Map information is not generated but only file contents are read.
- Only the ENC file or Dom file that stores the ENC is available.
Parameters
Section titled “Parameters”- const char *fn : IN (filename to read)
- CDomNode *node : IN, OUT (storage)
Return Value
Section titled “Return Value”-
= 0 : Read Success
- < 0 : Read Fail
hencIsUpdateENC
Section titled “hencIsUpdateENC”Prototype
Section titled “Prototype”int hencIsUpdateENC( CDomNode *node )Function
Section titled “Function”Check whether the map information is UpdateENC.
Parameters
Section titled “Parameters”- ENC information, It only works if it is a CDomNode read from a function.
Return Value
Section titled “Return Value”- == 0 : When it is judged as Update ENC
- != 0 : When it is judged as not Update ENC
hencGetEncVersion
Section titled “hencGetEncVersion”Prototype
Section titled “Prototype”int hencGetEncVersion( CDomNode *node, int &major, int &minor )Function
Section titled “Function”Load the ENC file version of the map information loaded with . It is used when comparing ENC files or comparing patch versions.
Parameters
Section titled “Parameters”- ENC Information, It must be a CDomNode read from the function to work correctly.
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencUpdateENCDom
Section titled “hencUpdateENCDom”Prototype
Section titled “Prototype”int hencUpdateENCDom( CDomNode *nodeBase, CDomNode *nodeUpdate )Function
Section titled “Function”Patch the S-57 file with two ENC files loaded with the function.
Parameters
Section titled “Parameters”- CDomNode *nodeBase : IN (BASE ENC)
- CDomNode *nodeUpdate : IN (UPDATE ENC)
Return Value
Section titled “Return Value”-
= 0 : Success
- < 0 : Fail
hencLoadDom
Section titled “hencLoadDom”Prototype
Section titled “Prototype”int hencLoadDom( CDomNode *node )Function
Section titled “Function”- Read map information from data with CDomNode format.
- It must be a CDomNode read from the to work correctly.
Parameters
Section titled “Parameters”CDomNode *node : IN, OUT (storage)
Return Value
Section titled “Return Value”-
= 0 : Read Success
- < 0 : Read Fail
hencSave
Section titled “hencSave”Prototype
Section titled “Prototype”int hencSave( const char *fn )Function
Section titled “Function”- All loaded map information is saved as CATALOG.SENC and SENC file for each map cell.
- The individual map cell file is stored in the same directory path as the CATALOG file.
Parameters
Section titled “Parameters”const char *fn : IN (CATALOG file name)
Return Value
Section titled “Return Value”- = 0 : Success
- < 0 : Fail
hencLoadFileListFromCatalogFile
Section titled “hencLoadFileListFromCatalogFile”Prototype
Section titled “Prototype”int hencLoadFileListFromCatalogFile( const char *fn, list &filelist )Function
Section titled “Function”Get a list of files from an ENC or SENC Catalog file.
Parameters
Section titled “Parameters”- const char *fn : IN (catalog file name)
- list &filelist : OUT (list of files)
Return Value
Section titled “Return Value”- = 0 : Success
- < 0 : Fail
hencSaveCatalogSENC
Section titled “hencSaveCatalogSENC”Prototype
Section titled “Prototype”int hencSaveCatalogSENC( const char *fn )Function
Section titled “Function”Only the Catalog SENC file of the loaded map is saved, not the cell file.
Parameters
Section titled “Parameters”const char *fn : IN (Name of catalog file to be saved)
Return Value
Section titled “Return Value”- = 0 : Success
- < 0 : Fail
hencEncfileSaveToSENC
Section titled “hencEncfileSaveToSENC”Prototype
Section titled “Prototype”int hencEncfileSaveToSENC( int no, const char *dirSave )Function
Section titled “Function”- Save the individual map cell file as a SENC file. At this time, the stored file name is used as the loaded file name.
- Only the features set to ObjMask are saved.
- See hencSetObjMask().
Parameters
Section titled “Parameters”- int no : IN
- Number of map cell to store
- When loading map cells, they are numbered sequentially from 0th.
- By using functions such as and , you can know the already loaded file name and number.
- const char *dirSave : IN (directory name to save)
Return Value
Section titled “Return Value”- = 0 : Success
- < 0 : Fail
hencEncfileToDom
Section titled “hencEncfileToDom”Prototype
Section titled “Prototype”int hencEncfileToDom( int no, CDomNode &dom )Function
Section titled “Function”Copy the information of the individual map cell file. Only the features set to ObjMask are saved when saved. See hencSetObjMask(). You can use internal information through the class CDomNode.
Parameters
Section titled “Parameters”- Number of map cell to store
- Map cells are numbered from 0 in the order they are loaded.
- By using functions such as and , you can know the already loaded file name and number.
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencEncfileSaveToMem
Section titled “hencEncfileSaveToMem”Prototype
Section titled “Prototype”int hencEncfileSaveToMem( int no, LPVOID &ptr, int &size )Function
Section titled “Function”Store and copy the information of the individual map cell file into memory with SENC. Only the features set to ObjMask are saved when saved. See .
Parameters
Section titled “Parameters”- Number of map cell to store
- Map cells are numbered from 0 in the order they are loaded.
- By using functions such as and , you can know the already loaded file name and number.
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencEncfileLoadFromMem
Section titled “hencEncfileLoadFromMem”Prototype
Section titled “Prototype”int hencEncfileLoadFromMem( LPVOID ptr, int size )Function
Section titled “Function”Read SENC from memory.
Parameters
Section titled “Parameters”LPVOID ptr : IN (SENC storage memory) int size : IN (size of SENC information)
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencUnload
Section titled “hencUnload”Prototype
Section titled “Prototype”int hencUnload( const char *fn )Function
Section titled “Function”Remove the map loaded with the filename from memory.
Parameters
Section titled “Parameters”- Must be the same as the file name given in the (int no).
- At this time, the file name does not include a path.
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
Prototype
Section titled “Prototype”int hencUnload( int idx )Function
Section titled “Function”Delete the map loaded with that number from memory.
Parameters
Section titled “Parameters”int idx : IN (map number)
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencUnloadAll
Section titled “hencUnloadAll”Prototype
Section titled “Prototype”int hencUnloadAll()Function
Section titled “Function”Delete loaded all map information from memory.
Parameters
Section titled “Parameters”None
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencEncfileSetLimit
Section titled “hencEncfileSetLimit”Prototype
Section titled “Prototype”int hencEncfileSetLimit( int cnt )Function
Section titled “Function”Limit the number of map cells loaded into memory. This can be used to create a demo version program.
Parameters
Section titled “Parameters”int cnt : IN (maximum number of cells)
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencEncfileGetCount
Section titled “hencEncfileGetCount”Prototype
Section titled “Prototype”int hencEncfileGetCount()Function
Section titled “Function”Gets the number of map cells loaded into memory.
Parameters
Section titled “Parameters”None
Return Value
Section titled “Return Value”Number of map cells loaded
hencEncfileGetName
Section titled “hencEncfileGetName”Prototype
Section titled “Prototype”const char *hencEncfileGetName( int no )Function
Section titled “Function”Obtain the filename of the loaded map cell.
Parameters
Section titled “Parameters”- Map cells are numbered from 0 in the order they are loaded.
Return Value
Section titled “Return Value”!= NULL : File name (Null-terminated string) == NULL : File name acquisition failed (file number not existing)
hencEncfileGetInfo
Section titled “hencEncfileGetInfo”Prototype
Section titled “Prototype”int hencEncfileGetInfo( int no, CDomNode &dom )Function
Section titled “Function”Acquires the file name and area information of the corresponding ENC.
Parameters
Section titled “Parameters”int no : IN (ENC number to acquire information) CDomNode &dom : OUT (Save file name and area information)
Return Value
Section titled “Return Value”= 0 : Success < 0 : Fail
hencIsENCFile
Section titled “hencIsENCFile”Prototype
Section titled “Prototype”bool hencIsENCFile( const char *fn )Function
Section titled “Function”Check that the input file is an S-57 ENC file.
Parameters
Section titled “Parameters”const char *fn : IN (inspection filename)
Return Value
Section titled “Return Value”true : If the ENC file is correct false : If it is an error or not ENC file
hencIsSENCFile
Section titled “hencIsSENCFile”Prototype
Section titled “Prototype”bool hencIsSENCFile( const char *fn )Function
Section titled “Function”Check that the input file is an hns SENC file.
Parameters
Section titled “Parameters”const char *fn : IN (inspection filename)
Return Value
Section titled “Return Value”true : If the SENC file is correct false : If it is an error or not SENC file
hencIsCatalogFile
Section titled “hencIsCatalogFile”Prototype
Section titled “Prototype”bool hencIsCatalogFile( const char *fn )Function
Section titled “Function”Check whether the file is a catalog file of ENC or SENC. And checks whether the file name is CATALOG.
Parameters
Section titled “Parameters”const char *fn : IN (inspection filename)
Return Value
Section titled “Return Value”true : Scan is successful (if the catalog file is correct) false : Check failed or error (if the catalog file does not match)
hencIsShapeFile
Section titled “hencIsShapeFile”Prototype
Section titled “Prototype”bool hencIsShapeFile( const char *fn )Function
Section titled “Function”Checks whether the file is a Shape file and confirms the extension of the file name.
Parameters
Section titled “Parameters”const char *fn : IN (inspection filename)
Return Value
Section titled “Return Value”true : Scan is successful. (if the shape file is correct) false : Check failed or error. (if the shape file does not match)
hencEncStringToMBC
Section titled “hencEncStringToMBC”Prototype
Section titled “Prototype”char *hencEncStringToMBC( const char *str )Function
Section titled “Function”It is used to decode a binary string used for storing ENC information loaded by and convert it into a multi-byte code.
Parameters
Section titled “Parameters”const char *str : IN (Encoded string)
Return Value
Section titled “Return Value”!= NULL : Converted string (Caller must free memory) == NULL : Conversion fail
The binary string that stores the ENC information has an encoding type and a binary string. It is a format for supporting the string encoding of the S-57 standard.