author | Michael Krelin <hacker@klever.net> | 2005-04-25 16:36:32 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-04-25 16:36:32 (UTC) |
commit | 981b219f5297ad2ccc1fc1d0e24e41ec009c35a3 (patch) (side-by-side diff) | |
tree | 9fa81d7fe70883ad26d946c902ba06edcebd4516 /components/exception_dev | |
parent | 54e344b7e3623e807b893b7febad3adfc6c1648f (diff) | |
download | sitecing-981b219f5297ad2ccc1fc1d0e24e41ec009c35a3.zip sitecing-981b219f5297ad2ccc1fc1d0e24e41ec009c35a3.tar.gz sitecing-981b219f5297ad2ccc1fc1d0e24e41ec009c35a3.tar.bz2 |
moved a few utility functions to konforka and bumped konforka version requirement accordingly
-rw-r--r-- | components/exception_dev | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/exception_dev b/components/exception_dev index d8c84e1..d62f462 100644 --- a/components/exception_dev +++ b/components/exception_dev @@ -1,28 +1,29 @@ %%decl using namespace std; <%impl> #include <iostream> #include <fstream> #include <sstream> #include <cassert> #include <cstdarg> #include <stdexcept> #include <cxxabi.h> #include <sitecing/sitecing_util.h> #include <sitecing/util.h> #include <sitecing/magic.h> + #include <konforka/util.h> #include <konforka/exception.h> </%impl> %%var string message; %%var string root_source; %%var string root_intermediate; %%var string root_so; %%var string component; %%var int line_number = -1; %%var const exception* exception_caught; <%code> __SCIF->headers.clear(); __SCIF->out->seekp(0); int magic = _magic; va_list va = _args; switch(magic) { case sitecing::__magic_compile_error: @@ -241,43 +242,43 @@ string fn = line.substr(0,c); string::size_type c1 = line.find(':',c+1); if(c1!=string::npos) { string ln = line.substr(c+1,c1-c-1); string::size_type nd = ln.find_first_not_of("0123456789"); if(nd==string::npos) { try { error_file = sitecing::strip_prefix(fn,"In file included from "); }catch(sitecing::utility_no_prefix& unp) { error_file = fn; } error_line = strtol(ln.c_str(),0,10); } } } if((oel>0 && !oef.empty()) && (oel!=error_line || oef!=error_file)) { - string ef = "/"+sitecing::combine_path(root_source+component,oef); + string ef = "/"+konforka::combine_path(root_source+component,oef); report_error(ef,oel,remove_roots(cumulative)); cumulative.clear(); } } if(!cumulative.empty()) cumulative += '\n'; cumulative += line; } if(!(cumulative.empty() || error_file.empty() || error_line<0)) { - error_file = "/"+sitecing::combine_path(root_source+component,error_file); + error_file = "/"+konforka::combine_path(root_source+component,error_file); report_error(error_file,error_line,remove_roots(cumulative)); } } </%code> </div> </%method> <%method void handle_unknown_error() %> <div class="exception-unknown"> <h1>unknown error</h1> </div> </%method> <%method void report_error(const string& file,long line,const string& message) %> <div class="exception-codepoint-report"> <h3><% sitecing::html_escape(strip_roots(file)) %></h3> <%code> if(line>=0) { @@ -305,33 +306,33 @@ snprintf(tln,sizeof(tln),"%5d",l); <%output> <li class="<% l==line?"focused":"unfocused" %>"><span class="lineno"><% sitecing::html_escape(tln,sitecing::html_escape_nbsp) %></span> <span class="line"><% sitecing::html_escape(str,sitecing::html_escape_nbsp) %></span></li> </%output> } <%output></ul></%output> } } } </%code> <div class="what"> <% sitecing::html_escape(message,sitecing::html_escape_br) %> </div> </div> </%method> <%codemethod string strip_roots(const string& filename) %> - string np = sitecing::normalize_path(filename); + string np = konforka::normalize_path(filename); try{ return sitecing::strip_prefix(np,root_source); }catch(sitecing::utility_no_prefix& e){ } try{ return sitecing::strip_prefix(np,root_intermediate); }catch(sitecing::utility_no_prefix& e){ } </%codemethod> <%codemethod string remove_roots(const string& str) %> string rv = str; string::size_type rp; string::size_type rl = root_source.length(); while((rp=rv.find(root_source))!=string::npos) { rv.erase(rp,rl); } rl = root_intermediate.length(); while((rp=rv.find(root_intermediate))!=string::npos) { |