OSDN Git Service

add tstools.
[rec10/rec10-git.git] / tstools / DtsEdit / src / gpac / config_file.h
diff --git a/tstools/DtsEdit/src/gpac/config_file.h b/tstools/DtsEdit/src/gpac/config_file.h
new file mode 100644 (file)
index 0000000..b855a48
--- /dev/null
@@ -0,0 +1,165 @@
+/*\r
+ *                     GPAC - Multimedia Framework C SDK\r
+ *\r
+ *                     Copyright (c) Jean Le Feuvre 2000-2005 \r
+ *                                     All rights reserved\r
+ *\r
+ *  This file is part of GPAC / common tools sub-project\r
+ *\r
+ *  GPAC is free software; you can redistribute it and/or modify\r
+ *  it under the terms of the GNU Lesser General Public License as published by\r
+ *  the Free Software Foundation; either version 2, or (at your option)\r
+ *  any later version.\r
+ *   \r
+ *  GPAC is distributed in the hope that it will be useful,\r
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *  GNU Lesser General Public License for more details.\r
+ *   \r
+ *  You should have received a copy of the GNU Lesser General Public\r
+ *  License along with this library; see the file COPYING.  If not, write to\r
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_CONFIG_FILE_H_\r
+#define _GF_CONFIG_FILE_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ *     \file <gpac/config_file.h>\r
+ *     \brief configuration file functions.\r
+ */\r
+\r
+ /*!\r
+ *     \addtogroup cfg_grp configuration\r
+ *     \ingroup utils_grp\r
+ *     \brief Configuration File object\r
+ *\r
+ *     This section documents the configuration file object of the GPAC framework.\r
+ *     This file is formatted as the INI file mode of WIN32 in sections and keys.\n\r
+ *\note For more information on the GPAC configuration file itself, please refer to the GPAC configuration help provided with GPAC.\r
+ *     @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+\r
+typedef struct __tag_config GF_Config;\r
+\r
+/*!\r
+ *     \brief configuration file constructor\r
+ *\r
+ *Constructs a configuration file\r
+ *\param filePath directory the file is located in\r
+ *\param fileName name of the configuration file\r
+ *\return the configuration file object\r
+ */\r
+GF_Config *gf_cfg_new(const char *filePath, const char *fileName);\r
+/*!\r
+ *     \brief configuration file destructor\r
+ *\r
+ *Destroys the configuration file and saves it if needed.\r
+ *\param cfgFile the target configuration file\r
+ */\r
+void gf_cfg_del(GF_Config *cfgFile);\r
+/*!\r
+ *     \brief configuration saving\r
+ *\r
+ *Saves the configuration file if modified.\r
+ *\param cfgFile the target configuration file\r
+ */\r
+GF_Err gf_cfg_save(GF_Config *iniFile);\r
+/*!\r
+ *     \brief key value query\r
+ *\r
+ *Gets a key value from its section and name.\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the desired key parent section name\r
+ *\param keyName the desired key name\r
+ *\return the desired key value if found, NULL otherwise.\r
+ */\r
+const char *gf_cfg_get_key(GF_Config *cfgFile, const char *secName, const char *keyName);\r
+/*!\r
+ *     \brief key value update\r
+ *\r
+ *Sets a key value from its section and name.\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the desired key parent section name\r
+ *\param keyName the desired key name\r
+ *\param keyValue the desired key value\r
+ *\note this will also create both section and key if they are not found in the configuration file\r
+ */\r
+GF_Err gf_cfg_set_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue);\r
+/*!\r
+ *     \brief section count query\r
+ *\r
+ *Gets the number of sections in the configuration file\r
+ *\param cfgFile the target configuration file\r
+ *\return the number of sections\r
+ */\r
+u32 gf_cfg_get_section_count(GF_Config *cfgFile);\r
+/*!\r
+ *     \brief section name query\r
+ *\r
+ *Gets a section name based on its index\r
+ *\param cfgFile the target configuration file\r
+ *\param secIndex 0-based index of the section to query\r
+ *\return the section name if found, NULL otherwise\r
+ */\r
+const char *gf_cfg_get_section_name(GF_Config *cfgFile, u32 secIndex);\r
+/*!\r
+ *     \brief key count query\r
+ *\r
+ *Gets the number of keys in a section of the configuration file\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ *\return the number of keys in the section\r
+ */\r
+u32 gf_cfg_get_key_count(GF_Config *cfgFile, const char *secName);\r
+/*!\r
+ *     \brief key count query\r
+ *\r
+ *Gets the number of keys in a section of the configuration file\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ *\param keyIndex 0-based index of the key in the section\r
+ *\return the key name if found, NULL otherwise\r
+ */\r
+const char *gf_cfg_get_key_name(GF_Config *cfgFile, const char *secName, u32 keyIndex);\r
+\r
+/*!\r
+ *     \brief key insertion\r
+ *\r
+ *Inserts a new key in a given section. Returns an error if a key with the given name \r
+ *already exists in the section\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ *\param keyName the name of the target key\r
+ *\param keyValue the value for the new key\r
+ *\param index the 0-based index position of the new key\r
+ */\r
+GF_Err gf_cfg_insert_key(GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue, u32 index);\r
+\r
+/*!\r
+ *     \brief section destrouction\r
+ *\r
+ *Removes all entries in the given section\r
+ *\param cfgFile the target configuration file\r
+ *\param secName the target section\r
+ */\r
+void gf_cfg_del_section(GF_Config *cfgFile, const char *secName);\r
+\r
+/*! @} */\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif         /*_GF_CONFIG_FILE_H_*/\r
+\r