Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F67427290
aka_common_inline_impl.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jun 22, 08:48
Size
1 KB
Mime Type
text/x-c
Expires
Mon, Jun 24, 08:48 (2 d)
Engine
blob
Format
Raw Data
Handle
18402474
Attached To
rAKA akantu
aka_common_inline_impl.cc
View Options
/**
* @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
Log In to Comment