File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
src/metadata/camerasxml_parser Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,7 @@ rawspeed-metadata-xmlparser = { path = "../xmlparser" }
19
19
20
20
[lib ]
21
21
path = " mod.rs"
22
+
23
+ [[bin ]]
24
+ name = " xmllint"
25
+ path = " xmllint.rs"
Original file line number Diff line number Diff line change
1
+ use rawspeed_metadata_camerasxml_parser:: camerasxml_parser;
2
+ use std:: env;
3
+ use std:: fs;
4
+
5
+ #[ expect( clippy:: print_stdout, clippy:: use_debug) ]
6
+ fn main ( ) -> Result < ( ) , Box < dyn core:: error:: Error > > {
7
+ let args: Vec < String > = env:: args ( ) . collect ( ) ;
8
+
9
+ let file_path = match args. get ( 2 ) {
10
+ Some ( p) => p,
11
+ None => "/home/lebedevri/rawspeed/data/cameras.xml" ,
12
+ } ;
13
+
14
+ println ! ( "In file {file_path}" ) ;
15
+
16
+ let contents = fs:: read_to_string ( file_path)
17
+ . expect ( "Should have been able to read the file" ) ;
18
+
19
+ let repr = camerasxml_parser:: parse_str ( & contents) ?;
20
+ println ! ( "{repr:#?}" ) ;
21
+ Ok ( ( ) )
22
+ }
You can’t perform that action at this time.
0 commit comments