diff --git a/core/misc.h b/core/misc.h index 6c38d85..5a26aa9 100755 --- a/core/misc.h +++ b/core/misc.h @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2008-2011, Tomasz Sowa + * Copyright (c) 2008-2012, Tomasz Sowa * All rights reserved. * */ @@ -249,6 +249,15 @@ typename StringType::size_type i; } +template +void MaxSize(StringType & str, size_t max_size) +{ + if( str.size() > max_size ) + str.erase(max_size); +} + + + wchar_t ToSmall(wchar_t c); void ToSmall(std::wstring & s);