18 #include <utility/file/FileName.hh>
21 #include <basic/Tracer.hh>
26 static basic::Tracer
TR(
"protocols.outputter.FormatStringOutputter");
29 void lregister_FormatStringOutputter( lua_State * lstate ) {
30 lregister_Outputter(lstate);
32 luabind::module(lstate,
"protocols")
34 luabind::namespace_(
"outputter")
36 luabind::class_<FormatStringOutputter, Outputter>(
"FormatStringOutputter")
52 TR <<
"-------Outputting PipeMap to File--------" << std::endl;
53 for( PipeMap::iterator itr = p.begin(); itr != p.end(); itr++ ) {
54 PipeSP current_pipe = itr->second;
57 write( *current_pipe );
63 for(
core::Size idx = 0; idx < p.size(); idx++ ) {
64 PoseSP current_pose = p[idx];
75 write( *current_pose );
83 bool in_potential_key =
false;
84 for(
core::Size i = 0; i < format_string.size() ; i++ ) {
85 if( format_string[i] !=
'%' && ! in_potential_key ) {
86 filename.push_back( format_string[i] );
87 }
else if ( format_string[i] ==
'%' && in_potential_key ) {
89 filename.push_back(
'%');
90 filename += potential_key;
92 }
else if ( format_string[i] ==
'%' ) {
93 in_potential_key =
true;
94 }
else if ( in_potential_key ) {
95 potential_key.push_back(format_string[i]);
96 boost::unordered_map< std::string, std::string>::iterator itr = filenameparts.find( potential_key );
97 if( itr != filenameparts.end() ) {
99 filename += itr->second;
100 in_potential_key=
false;
105 if( in_potential_key )
107 filename +=
'%' + potential_key;
112 void FormatStringOutputter::parse_def( utility::lua::LuaObject
const & def,
113 utility::lua::LuaObject
const & tasks ) {
117 void FormatStringOutputter::lregister( lua_State * lstate ) {
118 lregister_FormatStringOutputter(lstate);