Path: blob/master/thirdparty/metal-cpp/Foundation/NSURL.hpp
21066 views
//-------------------------------------------------------------------------------------------------------------------------------------------------------------1//2// Foundation/NSURL.hpp3//4// Copyright 2020-2024 Apple Inc.5//6// Licensed under the Apache License, Version 2.0 (the "License");7// you may not use this file except in compliance with the License.8// You may obtain a copy of the License at9//10// http://www.apache.org/licenses/LICENSE-2.011//12// Unless required by applicable law or agreed to in writing, software13// distributed under the License is distributed on an "AS IS" BASIS,14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15// See the License for the specific language governing permissions and16// limitations under the License.17//18//-------------------------------------------------------------------------------------------------------------------------------------------------------------1920#pragma once2122//-------------------------------------------------------------------------------------------------------------------------------------------------------------2324#include "NSDefines.hpp"25#include "NSObject.hpp"26#include "NSPrivate.hpp"27#include "NSTypes.hpp"2829//-------------------------------------------------------------------------------------------------------------------------------------------------------------3031namespace NS32{33class URL : public Copying<URL>34{35public:36static URL* fileURLWithPath(const class String* pPath);3738static URL* alloc();39URL* init();40URL* init(const class String* pString);41URL* initFileURLWithPath(const class String* pPath);4243const char* fileSystemRepresentation() const;44};45}4647//-------------------------------------------------------------------------------------------------------------------------------------------------------------4849_NS_INLINE NS::URL* NS::URL::fileURLWithPath(const String* pPath)50{51return Object::sendMessage<URL*>(_NS_PRIVATE_CLS(NSURL), _NS_PRIVATE_SEL(fileURLWithPath_), pPath);52}5354//-------------------------------------------------------------------------------------------------------------------------------------------------------------5556_NS_INLINE NS::URL* NS::URL::alloc()57{58return Object::alloc<URL>(_NS_PRIVATE_CLS(NSURL));59}6061//-------------------------------------------------------------------------------------------------------------------------------------------------------------6263_NS_INLINE NS::URL* NS::URL::init()64{65return Object::init<URL>();66}6768//-------------------------------------------------------------------------------------------------------------------------------------------------------------6970_NS_INLINE NS::URL* NS::URL::init(const String* pString)71{72return Object::sendMessage<URL*>(this, _NS_PRIVATE_SEL(initWithString_), pString);73}7475//-------------------------------------------------------------------------------------------------------------------------------------------------------------7677_NS_INLINE NS::URL* NS::URL::initFileURLWithPath(const String* pPath)78{79return Object::sendMessage<URL*>(this, _NS_PRIVATE_SEL(initFileURLWithPath_), pPath);80}8182//-------------------------------------------------------------------------------------------------------------------------------------------------------------8384_NS_INLINE const char* NS::URL::fileSystemRepresentation() const85{86return Object::sendMessage<const char*>(this, _NS_PRIVATE_SEL(fileSystemRepresentation));87}8889//-------------------------------------------------------------------------------------------------------------------------------------------------------------909192