/****************************************************************************** libx42.net - skinned vertex animation library (.NET API) Copyright (C) 2007 HermitWorks Entertainment Corporation 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. 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA. ******************************************************************************/ #include "Stdafx.h" #include "Util.h" System::String^ GetGcString( const char *str ) { if( !str ) throw gcnew System::ArgumentNullException( "str" ); size_t len = strlen( str ); if( !len ) return String::Empty; array< Byte >^ buf = gcnew array< Byte >( (int)len ); pin_ptr< Byte > pinBuf = &buf[0]; memcpy( pinBuf, str, len ); pinBuf = nullptr; return System::Text::Encoding::ASCII->GetString( buf ); }