Page MenuHomec4science

aka_common_inline_impl.cc
No OneTemporary

File Metadata

Created
Sat, Jun 22, 08:48

aka_common_inline_impl.cc

/**
* @file aka_common_inline_impl.cc
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @date Fri Jun 11 09:48:06 2010
*
* @namespace akantu
*
* @section LICENSE
*
* Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu 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 Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
* @section DESCRIPTION
*
* All common things to be included in the projects files
*
*/
#include <algorithm>
__BEGIN_AKANTU__
/* -------------------------------------------------------------------------- */
inline void to_lower(std::string & str) {
std::transform(str.begin(),
str.end(),
str.begin(),
(int(*)(int))std::tolower);
}
/* -------------------------------------------------------------------------- */
inline void trim(std::string & to_trim) {
size_t first = to_trim.find_first_not_of(" \t");
if (first != std::string::npos) {
size_t last = to_trim.find_last_not_of(" \t");
to_trim = to_trim.substr(first, last - first + 1);
} else to_trim = "";
}
__END_AKANTU__

Event Timeline