Sha256: d3be7a0565f1a4e370c29d79148a1a703a7c4399eec2a21c5ef5c8ee85f26f38

Contents?: true

Size: 925 Bytes

Versions: 16

Compression:

Stored size: 925 Bytes

Contents

//! \file Utility.hpp
//! General purpose utility functions.

#pragma once

#include <string>

namespace Gosu
{
    //! Converts an UTF-8 to UCS-4 or UTF-16, depending on the platform's interpretation of wstring.
    std::wstring utf8_to_wstring(const std::string& utf8);
    //! Converts an UCS-4 or UTF-16 to UTF-8, depending on the platform's interpretation of wstring.
    std::string wstring_to_utf8(const std::wstring& ws);
    
    //! Returns true if the filename has the given extension.
    //! The comparison is case-insensitive, but you must pass the extension in lower case.
    bool has_extension(const std::string& filename, const char* extension);
    
    //! Returns the user's preferred language, at the moment of calling the function. Expect return
    //! values such as 'en_US', 'de_DE.UTF-8', 'ja', 'zh-Hans'.
    //! The first two letters will always be a language code.
    std::string language();
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
gosu-0.13.3 Gosu/Utility.hpp
gosu-0.13.2 Gosu/Utility.hpp
gosu-0.13.1 Gosu/Utility.hpp
gosu-0.13.0 Gosu/Utility.hpp
gosu-0.12.1 Gosu/Utility.hpp
gosu-0.12.0 Gosu/Utility.hpp
gosu-0.11.4.pre3 Gosu/Utility.hpp
gosu-0.11.4.pre2 Gosu/Utility.hpp
gosu-0.11.4.pre1 Gosu/Utility.hpp
gosu-0.11.3.1 Gosu/Utility.hpp
gosu-0.11.3 Gosu/Utility.hpp
gosu-0.11.3.pre1 Gosu/Utility.hpp
gosu-0.11.2 Gosu/Utility.hpp
gosu-0.11.1 Gosu/Utility.hpp
gosu-0.11.1.pre1 Gosu/Utility.hpp
gosu-0.11.0 Gosu/Utility.hpp