// Copyright © 2010-2013 The CefSharp Project. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #include "Stdafx.h" #include "include/cef_base.h" #pragma once using namespace System; namespace CefSharp { namespace Internals { private class StringUtils { public: /// /// Converts an unmanaged string to a (managed) .NET string. /// /// The string that should be converted. /// A .NET string. static String^ ToClr(const cef_string_t& cefStr); /// /// Converts an unmanaged string to a (managed) .NET string. /// /// The string that should be converted. /// A .NET string. static String^ ToClr(const CefString& cefStr); /// /// Converts a .NET string to native (unmanaged) format. Note that this method does not allocate a new copy of the // string, but rather returns a pointer to the memory in the existing managed String object. /// /// The string that should be converted. /// An unmanaged representation of the provided string, or an empty string if the input string is a nullptr. static CefString ToNative(String^ str); /// /// Assigns the provided cef_string_t object from the given .NET string. /// /// The cef_string_t that should be updated. /// The .NET string whose value should be used to update cefStr. static void AssignNativeFromClr(cef_string_t& cefStr, String^ str); }; } }