//===================================================== // File : btl.hh // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr> //===================================================== // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #ifndef BTL_HH #define BTL_HH
#ifdef __SSE__ #include"xmmintrin.h" // This enables flush to zero (FTZ) and denormals are zero (DAZ) modes: #define BTL_DISABLE_SSE_EXCEPTIONS() { _mm_setcsr(_mm_getcsr() | 0x8040); } #else #define BTL_DISABLE_SSE_EXCEPTIONS() #endif
/** Decompose the current string as a path and a file. For instance: "dir1/dir2/file.ext" leads to path="dir1/dir2/" and filename="file.ext"
*/ void decomposePathAndFile(BtlString& path, BtlString& filename) const
{
std::vector<BtlString> elements = this->split("/\\");
path = "";
filename = elements.back();
elements.pop_back(); if (this->at(0)=='/')
path = "/"; for (unsignedint i=0 ; i<elements.size() ; ++i)
path += elements[i] + "/";
}
};
class BtlConfig
{ public:
BtlConfig()
: overwriteResults(false), checkResults(true), realclock(false), tries(DEFAULT_NB_TRIES)
{ char * _config;
_config = getenv ("BTL_CONFIG"); if (_config!=NULL)
{
std::vector<BtlString> config = BtlString(_config).split(" \t\n"); for (unsignedint i = 0; i<config.size(); i++)
{ if (config[i].beginsWith("-a"))
{ if (i+1==config.size())
{
std::cerr << "error processing option: " << config[i] << "\n"; exit(2);
}
Instance.m_selectedActionNames = config[i+1].split(":");
BTL_DONT_INLINE staticbool skipAction(const std::string& _name)
{ if (Instance.m_selectedActionNames.empty()) returnfalse;
BtlString name(_name); for (unsignedint i=0; i<Instance.m_selectedActionNames.size(); ++i) if (name.contains(Instance.m_selectedActionNames[i])) returnfalse;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.