🎉 Updated copyright, removed unnecessary Switch code, and updated makefiles.

main v2.1.1
Nichole Mattera 1 year ago
parent 5c341008bc
commit c28ea183a6
  1. 2
      .gitignore
  2. 2
      LICENSE
  3. 22
      Makefile
  4. 2
      README.md
  5. 11
      example/Creating/Makefile
  6. 6
      example/Creating/source/main.cpp
  7. 11
      example/Editing/Makefile
  8. 6
      example/Editing/source/main.cpp
  9. 11
      example/Magic/Makefile
  10. 6
      example/Magic/source/main.cpp
  11. 11
      example/Reading/Makefile
  12. 6
      example/Reading/source/main.cpp
  13. 4
      include/SimpleIniParser.hpp
  14. 5
      include/SimpleIniParser/Ini.hpp
  15. 5
      include/SimpleIniParser/IniHelper.hpp
  16. 4
      include/SimpleIniParser/IniOption.hpp
  17. 5
      include/SimpleIniParser/IniSection.hpp
  18. 17
      include/SimpleIniParser/IniStringHelper.hpp
  19. 7
      source/SimpleIniParser/Ini.cpp
  20. 6
      source/SimpleIniParser/IniHelper.cpp
  21. 4
      source/SimpleIniParser/IniOption.cpp
  22. 4
      source/SimpleIniParser/IniSection.cpp
  23. 19
      source/SimpleIniParser/IniStringHelper.cpp

2
.gitignore vendored

@ -10,4 +10,4 @@ lib
.vscode
*.tar.bz2
*.tar.xz
*.tar.gz
*.tar.gz

@ -1,4 +1,4 @@
Copyright (c) 2020 Nichole Mattera
Copyright (c) 2021 Nichole Mattera
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above

@ -15,14 +15,14 @@ include $(DEVKITPRO)/libnx/switch_rules
# INCLUDES is a list of directories containing header files
#---------------------------------------------------------------------------------
TARGET := SimpleIniParser
VERSION := 1.0.0
VERSION := 2.1.1
SOURCES := source source/SimpleIniParser
INCLUDES := include include/SimpleIniParser
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec
CFLAGS := -g -Wall -Werror \
-ffunction-sections \
@ -36,16 +36,11 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
ASFLAGS := -g $(ARCH)
ifneq (,$(shell which ccache))
CXX := $(shell which ccache) $(CXX)
CC := $(shell which ccache) $(CC)
endif
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX)
LIBDIRS := $(PORTLIBS) $(LIBNX)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@ -83,8 +78,7 @@ export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I. \
-iquote $(CURDIR)/include/switch/
-I$(CURDIR)/$(BUILD)
.PHONY: clean all
@ -114,6 +108,14 @@ lib/lib$(TARGET)d.a : lib debug $(SOURCES) $(INCLUDES)
--no-print-directory -C debug \
-f $(CURDIR)/Makefile
dist-bin: all
@tar --exclude=*~ -cjf lib$(TARGET).tar.bz2 include lib
dist-src:
@tar --exclude=*~ -cjf lib$(TARGET)-src.tar.bz2 include source Makefile
dist: dist-src dist-bin
#---------------------------------------------------------------------------------
clean:
@echo clean ...

@ -1,4 +1,4 @@
# SimpleIniParser
# Simple INI Parser
A library for the Nintendo Switch to be able to easily parse, modify, and create INI files. The main reason this library was written was due to the special needs of the hekate ini file. The hekate ini file can have the same key used multiple times within the same section, and its captions surrounded by curly braces. As these are outside the ini standard, other ini parsers would remove the duplicate keys and strip out the captions.

@ -43,14 +43,14 @@ SOURCES := source
DATA := data
INCLUDES := include
APP_TITLE := SimpleIniParser Creating Example
APP_TITLE := Simple INI Parser Creating Example
APP_AUTHOR := Nichole Mattera
APP_VERSION := 2.0.1
APP_VERSION := 2.1.1
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
@ -64,11 +64,6 @@ LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*
LIBS := -lSimpleIniParser -lnx
ifneq (,$(shell which ccache))
CXX := $(shell which ccache) $(CXX)
CC := $(shell which ccache) $(CC)
endif
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -73,4 +73,4 @@ int main(int argc, char **argv) {
consoleExit(NULL);
return 0;
}
}

@ -44,14 +44,14 @@ DATA := data
INCLUDES := include
ROMFS := romfs
APP_TITLE := SimpleIniParser Editing Example
APP_TITLE := Simple INI Parser Editing Example
APP_AUTHOR := Nichole Mattera
APP_VERSION := 2.0.1
APP_VERSION := 2.1.1
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
@ -65,11 +65,6 @@ LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*
LIBS := -lSimpleIniParser -lnx
ifneq (,$(shell which ccache))
CXX := $(shell which ccache) $(CXX)
CC := $(shell which ccache) $(CC)
endif
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -68,4 +68,4 @@ int main(int argc, char **argv) {
consoleExit(NULL);
return 0;
}
}

@ -43,14 +43,14 @@ SOURCES := source
DATA := data
INCLUDES := include
APP_TITLE := SimpleIniParser Magic Example
APP_TITLE := Simple INI Parser Magic Example
APP_AUTHOR := Nichole Mattera
APP_VERSION := 2.0.1
APP_VERSION := 2.1.1
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
@ -64,11 +64,6 @@ LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*
LIBS := -lSimpleIniParser -lnx
ifneq (,$(shell which ccache))
CXX := $(shell which ccache) $(CXX)
CC := $(shell which ccache) $(CC)
endif
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -112,4 +112,4 @@ int main(int argc, char **argv) {
consoleExit(NULL);
return 0;
}
}

@ -44,14 +44,14 @@ DATA := data
INCLUDES := include
ROMFS := romfs
APP_TITLE := SimpleIniParser Reading Example
APP_TITLE := Simple INI Parser Reading Example
APP_AUTHOR := Nichole Mattera
APP_VERSION := 2.0.1
APP_VERSION := 2.1.1
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
@ -65,11 +65,6 @@ LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*
LIBS := -lSimpleIniParser -lnx
ifneq (,$(shell which ccache))
CXX := $(shell which ccache) $(CXX)
CC := $(shell which ccache) $(CC)
endif
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -120,4 +120,4 @@ int main(int argc, char **argv) {
consoleExit(NULL);
return 0;
}
}

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -46,6 +46,5 @@ namespace simpleIniParser {
private:
static Ini * _parseContent(std::stringstream * content, std::string magic);
};
}

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -27,6 +27,5 @@ namespace simpleIniParser {
public:
static bool findOption(const IniOption * obj, std::string term, bool caseSensitive, IniOptionType type, IniOptionSearchField field);
static bool findSection(const IniSection * obj, std::string term, bool caseSensitive, IniSectionType type);
};
}

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -44,6 +44,5 @@ namespace simpleIniParser {
std::vector<IniOption *> findAllOptions(std::string term, bool caseSensitive = true, IniOptionType type = IniOptionType::Any, IniOptionSearchField field = IniOptionSearchField::Key);
std::string build();
static IniSection * parse(std::string line, bool parseComments);
};
}

@ -1,3 +1,20 @@
/*
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#pragma once
#include <string>

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -20,7 +20,6 @@
#include <functional>
#include <iostream>
#include <sstream>
#include <switch.h>
#include "Ini.hpp"
#include "IniHelper.hpp"
@ -185,8 +184,6 @@ namespace simpleIniParser {
file.flush();
file.close();
fsdevCommitDevice("sdmc");
return true;
}

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -43,5 +43,3 @@ namespace simpleIniParser {
return fieldValue == term;
}
}

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above

@ -1,6 +1,6 @@
/*
* SimpleIniParser
* Copyright (c) 2020 Nichole Mattera
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above

@ -1,4 +1,19 @@
/*
* Simple INI Parser
* Copyright (c) 2021 Nichole Mattera
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <algorithm>
#include <cctype>
@ -52,5 +67,3 @@ namespace simpleIniParser {
}
// End
}

Loading…
Cancel
Save