📄 conf.h
字号:
/* * $File: conf.h * $Author: Jiakai -- gy_jk@126.com * $Date: Sat Nov 29 00:23:53 2008*//*Copyright (C) (2008) (Jiakai) <gy_jk@126.com>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef HEADER_CONF#define HEADER_CONFconst int INTEGER_LENGTH = 20;const int DOUBLE_LENGTH = 100;class Conf{ struct List_section; struct List_item; List_section *datahead, *datatail; char *filename; void init(); List_section* lookfor_section(const char *name) const; // return NULL if nothing is found. List_item* lookfor_item(const List_section *section, const char *name) const; //return NULL if nothing is found.public: Conf(const char *file); bool read(const char *section, const char *item, double &value) const; bool read(const char *section, const char *item, int &value) const; bool read(const char *section, const char *item, char *value, unsigned maxlen) const; //maxlen does not include the '\0'. void write(const char *section, const char *item, double value); void write(const char *section, const char *item, int value); void write(const char *section, const char *item, const char *value); void delitem(const char *section, const char *item); void delsection(const char *section); void del_all(); bool save() const; unsigned long int item_len(const char *section, const char *item) const; const char * get_file_path() const; ~Conf();};#endif //HEADER_CONF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -