Path: blob/master/thirdparty/metal-cpp/Foundation/NSData.hpp
21066 views
//-------------------------------------------------------------------------------------------------------------------------------------------------------------1//2// Foundation/NSData.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 "NSObject.hpp"25#include "NSTypes.hpp"2627//-------------------------------------------------------------------------------------------------------------------------------------------------------------2829namespace NS30{31class Data : public Copying<Data>32{33public:34void* mutableBytes() const;35void* bytes() const;36UInteger length() const;37};38}3940//-------------------------------------------------------------------------------------------------------------------------------------------------------------4142_NS_INLINE void* NS::Data::mutableBytes() const43{44return Object::sendMessage<void*>(this, _NS_PRIVATE_SEL(mutableBytes));45}4647_NS_INLINE void* NS::Data::bytes() const48{49return Object::sendMessage<void*>(this, _NS_PRIVATE_SEL(bytes));50}5152//-------------------------------------------------------------------------------------------------------------------------------------------------------------5354_NS_INLINE NS::UInteger NS::Data::length() const55{56return Object::sendMessage<UInteger>(this, _NS_PRIVATE_SEL(length));57}5859//-------------------------------------------------------------------------------------------------------------------------------------------------------------606162