Made on Kubuntu
00001 // Copyright (C) 2009-2010 Ferdinand Majerech 00002 // This file is part of MiniINI 00003 // For conditions of distribution and use, see copyright notice in LICENSE.txt 00004 00005 #include "typedefs.h" 00006 #include "globals.h" 00007 00009 namespace miniini_private 00010 { 00011 c comment = ';'; 00012 00013 c namevalsep = '='; 00014 00015 c linesep[3] = {10, 13, 0}; 00016 } 00018 00019 bool INISetComment(const char commentchar) 00020 { 00021 switch(commentchar) 00022 { 00023 //Can't set to any character that is already used for something else. 00024 case ' ': 00025 case '\t': 00026 case 10: 00027 case 13: 00028 case '[': 00029 case ']': 00030 case '\0': 00031 return false; 00032 break; 00033 default: 00034 { 00035 if(commentchar == miniini_private::namevalsep) 00036 { 00037 return false; 00038 } 00039 miniini_private::comment = commentchar; 00040 return true; 00041 } 00042 break; 00043 } 00044 } 00045 00046 bool INISetSeparator(const char sep) 00047 { 00048 switch(sep) 00049 { 00050 //Can't set to any character that is already used for something else. 00051 case ' ': 00052 case '\t': 00053 case 10: 00054 case 13: 00055 case '[': 00056 case ']': 00057 case '\0': 00058 return false; 00059 break; 00060 default: 00061 { 00062 if(sep == miniini_private::comment) 00063 { 00064 return false; 00065 } 00066 miniini_private::namevalsep = sep; 00067 return true; 00068 } 00069 break; 00070 } 00071 }