This documenta- tion describes the current state of development.
Note that interfaces and functionality may still change.

Prokee Modules:
  A
  B
  C
  D
  E
  F
  G
  I
  L
  M
  N
  O
  P
  R
  S
  T
  U
  W

     open all    |    close all

GUI Elements:
  B
  C
  I
  M
  P
  R
  S
  T

     open all    |    close all

GUI Interactions:
  B
  F
  H
  S

     open all    |    close all

GUI Layouts:
  L

     open all    |    close all

Games/Demos:
  M

     open all    |    close all

Third Party Libraries:
  P
  F
  Z

     open all    |    close all

Information about this Website / Informationen zu dieser Webseite:
In case of any questions, or comments, please feel free to contact me via email at apoll500@gmail.com.

Module removebom [Version: v01]

This documentation describes the Prokee module interface.


Functions:
removebom_run
int removebom_run(const char *filepath,const char *file_extensions,bool flat,bool restore,bool print_log)
removebom_run2
int removebom_run2(const char *filepath,char **file_extensions,bool flat,bool restore,bool print_log)

Static Methods:
main
int removebom::main(int argc,char **argv)

Motivation

UTF-8 encoded text files my contain a BOM (Byte-Order-Mark) at the beginning of the file. The BOM can be useful to recognize UTF-8 encoded files, but it is not required for decoding UTF-8 characters. Removing the BOM, should do no harm to the readability of UTF-8 files by modern text editors. In some situations, the unexpected existence of the BOM may lead to problems. E.g. if the contents of a file should be inserted into another file, the BOM my be copied as well and show up as invalid character within the new file. To avoid such problems, this module provides a function to remove the BOM from files.


Functions

   removebom_run


Removes (or adds) the utf8 Byte-Order-Mark (BOM) from (to) files.

Signature:
int removebom_run(const char *filepath,const char *file_extensions,bool flat,bool restore,bool print_log)

Parameters:
Type Name Direction Description
const char *filepath[IN]Path to a file or directory.
const char *file_extensions[IN]The filename extensions to search for. Multiple filename extensions have to be deliminated by a comma ','.
bool flattrue for non-recursive mode and false to recursively search through sub-directories.
bool restoreIf restore is set to true, the function adds a BOM to files instead of removing it.
bool print_logIf print_log is set to true, the function generates some output to stdout.

Return value:
Returns 0.

Tests:
test1: Removes the BOM from a test file.
    Test function: removebom_run()

   removebom_run2


Removes (or adds) the utf8 Byte-Order-Mark (BOM) from (to) files.

Signature:
int removebom_run2(const char *filepath,char **file_extensions,bool flat,bool restore,bool print_log)

Parameters:
Type Name Direction Description
const char *filepath[IN]Path to a file or directory.
char **file_extensions[IN]The filename extensions to search for. This may be set to NULL, to allow any filename extension. If not set to NULL, file_extensions has to be a null-terminated sequence of pointers to null-terminated strings containing the filename extensions to look for.
bool flattrue for non-recursive mode and false to recursively search through sub-directories.
bool restoreIf restore is set to true, the function adds a BOM to files instead of removing it.
bool print_logIf print_log is set to true, the function generates some output to stdout.

Return value:
Returns 0.


Static Methods

   main


Runs removebom as if it would be called from the command-line.

See Commandline-Interface.

Signature:
int removebom::main(int argc,char **argv)

Parameters:
Type Name Direction Description
int argcThe number of command-line parameters.
char **argv[IN]The command-line parameters.

Return value:
Exit status.


Copyright © 2017 - 2019 by Andreas Pollhammer