Comments (4)
FYI, if you have multiple repeated options, you can use the () operator to get all values. Operator [] will only give you one (the last). args("option")
returns an array with all values for the given option, unlike args["option"]
:
Array<String> cfs = args("cf"); // -> ["config/readmesh.ini", "data/checkmesh/cubeandisolatedvertex.obj"]
for(auto cf : cfs)
{
read(cf);
}
Parsing multiple options does not seem to be the problem. The crash appears in IniFile
which seems to be parsing a badly formatted file. I just identified a possible cause that I'll try to fix. It expects an '=' sign which might be missing in the file. Is the ini file correct?
Anyway, are you passing "cubeandisolatedvertex.obj" to the IniFile reader? Is that an INI-like file?
from asl.
The crash happened in the IniFile destructor. It checks if we have modified or added any values, to save the file in that case. And there it encountered some missing '='.
I fixed that and another case (if there is a line starting with [
but not closing with ]
). Now it will be more forgiving.
It's in the latest master version (pull the latest git version or download the repository zip).
from asl.
An example ini file:
[iteration0]
inputfilename=data/alltriscube.obj
source=0
operation=6
[iteration1]
source=0
operation=7
outputfilename=YES
[iteration2]
source=0
operation=4
# end
you're right, the problem is the obj file passed in place of ini one. It is a text file of the form:
# Blender v2.79 (sub 0) OBJ File: 'triplane_cone_triscube_cube8.blend'
# www.blender.org
v -1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
s off
f 2 3 1
f 4 7 3
f 8 5 7
f 6 1 5
f 7 1 3
f 4 6 8
f 2 4 3
f 4 8 7
f 8 6 5
f 6 2 1
f 7 5 1
f 4 2 6
l 2 0
l 3 2
l 3 7
l 7 5
l 5 4
l 0 4
if I do:
test/at3d -cf data/alltriscube.obj
the error above shows up. Curiously enough, just discovered, if I do:
test/at3d -cf data/
that is passing only a directory without file, debugger shows everything stops at line 79, never returing. Sanitizers are silent.
I'll modify the code so as to manage multiple options the way you showed. Thank you for your help.
from asl.
Anyway, shouldn't the obj file be assigned to a different option (not -cf
) since it is not a config file?
test/at3d -cf config/readmesh.ini -obj data/checkmesh/cubeandisolatedvertex.obj
-cf
for config file and -obj
for input obj file. Or even without an option:
test/at3d -cf config/readmesh.ini data/checkmesh/cubeandisolatedvertex.obj
There you will have
args.length(); // -> 1: number of free arguments which are not options
args[0]; // -> "data/checkmesh/cubeandisolatedvertex.obj"
args["cf"]; // -> "config/readmesh.ini"
from asl.
Related Issues (19)
- UUID generator ASL helper class HOT 1
- asl::sleep causes a SEGFAULT in raspberry pi HOT 3
- HTTPS support is broken HOT 2
- Feature request: Add certificates to requests HOT 1
- Build errors HOT 3
- Feature request: FTP & SMTP support (with SSL and without) HOT 1
- A lot of C2445 errors with Visual Studio 2017 HOT 6
- SocketServer can be destroyed before SockClientThread workers ends HOT 3
- Converting String to std::string HOT 2
- Can't download GitHub release HOT 5
- A broken ini file causes segfaults when read with write parameter set HOT 4
- Get the current process data like in Process class for subprocesses HOT 3
- question: printing out single character HOT 2
- chars() problem HOT 4
- add method for Dic<Var>, adds to other Dic... HOT 10
- Map join doesn't getting applied to the levels HOT 2
- Dynamic library load does not add ".dll" to the library name HOT 1
- Could you open Github Discussions?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asl.