Skip to content

Commit

Permalink
ParamParse: Prefix Inputs Search
Browse files Browse the repository at this point in the history
Demonstrate the prefix-based inputs keyword search.
  • Loading branch information
ax3l committed May 22, 2021
1 parent e12d19c commit 570f2b7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Basic/main_C/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,21 @@ void test_parameters ()
pp.getarr("an_int_array", ia);
pp.get("a_real_scalar", r);
pp.get("a_string", s);
amrex::Print() << "an_int_array = ";
amrex::Print() << "a_prefix.an_int_array = ";
for (auto x : ia) {
amrex::Print() << x << " ";
}
amrex::Print() << "\n";
amrex::Print() << "a_prefix.a_real_scalar = " << r << "\n"
<< "a_prefix.a_string = " << s << "\n";
}

{
amrex::ParmParse pp;
amrex::Print() << "Inputs that start with 'a_prefix':\n";
auto entr = pp.getEntries ("a_prefix");
for (auto && v : entr) {
amrex::Print() << " " << v << "\n";
}
}
}

0 comments on commit 570f2b7

Please sign in to comment.