Skip to content

Commit 570f2b7

Browse files
committed
ParamParse: Prefix Inputs Search
Demonstrate the prefix-based inputs keyword search.
1 parent e12d19c commit 570f2b7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Basic/main_C/main.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,21 @@ void test_parameters ()
9999
pp.getarr("an_int_array", ia);
100100
pp.get("a_real_scalar", r);
101101
pp.get("a_string", s);
102-
amrex::Print() << "an_int_array = ";
102+
amrex::Print() << "a_prefix.an_int_array = ";
103103
for (auto x : ia) {
104104
amrex::Print() << x << " ";
105105
}
106106
amrex::Print() << "\n";
107107
amrex::Print() << "a_prefix.a_real_scalar = " << r << "\n"
108108
<< "a_prefix.a_string = " << s << "\n";
109109
}
110+
111+
{
112+
amrex::ParmParse pp;
113+
amrex::Print() << "Inputs that start with 'a_prefix':\n";
114+
auto entr = pp.getEntries ("a_prefix");
115+
for (auto && v : entr) {
116+
amrex::Print() << " " << v << "\n";
117+
}
118+
}
110119
}

0 commit comments

Comments
 (0)