first-team-1699 / ini-reader Goto Github PK
View Code? Open in Web Editor NEWOur configuration file reader, used with many robots over many years.
License: MIT License
Our configuration file reader, used with many robots over many years.
License: MIT License
Read a line, and give it a type automatically.
ini-reader keeps getting more and more complicated, there needs to be a good tutorial on how to use it. I will write a wiki soon-ish.
The object reading and writing methods are currently broken, they only work for certain objects.
So 200 lines of code is a bit excessive for a single method. We should at least create helper methods that make the code more readable. I was thinking we would pull the parsing out of the lines out of the method. That might require us to make rawConfigSection and/or rawConfigLine objects that hold unparsed versions or ConfigSection and/or ConfigLine objects.
We could also create new classes to specifically handle building up the ConfigSecion and ConfigLine Objects. Following the Builder Design Pattern should help implement it this way .
This is a low priority but I might make a new branch to try to clean it up and make it more manageable without killing it.
Currently, a ConfigFile contains ConfigSections, which in turn contain ConfigLines<>. This level of separation was designed in order to decrease the number of ini files needed on the robot itself, instead only one ConfigFile is used and multiple ConfigSections are used to contain data for separate parts of the robot or certain autonomous configurations. But, when getting a value from a ConfigSection, one of two functions can be used: .getSection(int a)
and .getSection(String name)
. .getSection(int a)
returns null
if the given index is out of bounds (and the .size()
method should be used to make sure this does not happen). But, the .getSection(String name)
raises a NotFoundException if the given name does not exist in the ConfigFile or ConfigSection. How should this exception be handled, should it be checked (forced to be in a try/catch or declared in the method header) or should it be unchecked (crashes code)? Also, should the way that .getSection(int a)
returns an error be changed?
Add types like float and byte.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.