// WARNING - AUTOGENERATED - DO NOT EDIT // // Generated using `sharpie urho` // // PackageFile.cs // // Copyright 2015 Xamarin Inc. All rights reserved. using System; using System.Runtime.InteropServices; using System.Collections.Generic; using Urho.Urho2D; using Urho.Gui; using Urho.Resources; using Urho.IO; using Urho.Navigation; using Urho.Network; namespace Urho.IO { /// /// Stores files of a directory tree sequentially for convenient access. /// public unsafe partial class PackageFile : UrhoObject { unsafe partial void OnPackageFileCreated (); [Preserve] public PackageFile (IntPtr handle) : base (handle) { OnPackageFileCreated (); } [Preserve] protected PackageFile (UrhoObjectFlag emptyFlag) : base (emptyFlag) { OnPackageFileCreated (); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern int PackageFile_GetType (IntPtr handle); private StringHash UrhoGetType () { Runtime.ValidateRefCounted (this); return new StringHash (PackageFile_GetType (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr PackageFile_GetTypeName (IntPtr handle); private string GetTypeName () { Runtime.ValidateRefCounted (this); return Marshal.PtrToStringAnsi (PackageFile_GetTypeName (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern int PackageFile_GetTypeStatic (); private static StringHash GetTypeStatic () { Runtime.Validate (typeof(PackageFile)); return new StringHash (PackageFile_GetTypeStatic ()); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr PackageFile_GetTypeNameStatic (); private static string GetTypeNameStatic () { Runtime.Validate (typeof(PackageFile)); return Marshal.PtrToStringAnsi (PackageFile_GetTypeNameStatic ()); } [Preserve] public PackageFile () : this (Application.CurrentContext) { } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr PackageFile_PackageFile (IntPtr context); [Preserve] public PackageFile (Context context) : base (UrhoObjectFlag.Empty) { Runtime.Validate (typeof(PackageFile)); handle = PackageFile_PackageFile ((object)context == null ? IntPtr.Zero : context.Handle); Runtime.RegisterObject (this); OnPackageFileCreated (); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr PackageFile_PackageFile0 (IntPtr context, string fileName, uint startOffset); [Preserve] public PackageFile (Context context, string fileName, uint startOffset = 0) : base (UrhoObjectFlag.Empty) { Runtime.Validate (typeof(PackageFile)); handle = PackageFile_PackageFile0 ((object)context == null ? IntPtr.Zero : context.Handle, fileName, startOffset); Runtime.RegisterObject (this); OnPackageFileCreated (); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool PackageFile_Open (IntPtr handle, string fileName, uint startOffset); /// /// Open the package file. Return true if successful. /// public bool Open (string fileName, uint startOffset = 0) { Runtime.ValidateRefCounted (this); return PackageFile_Open (handle, fileName, startOffset); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool PackageFile_Exists (IntPtr handle, string fileName); /// /// Check if a file exists within the package file. This will be case-insensitive on Windows and case-sensitive on other platforms. /// public bool Exists (string fileName) { Runtime.ValidateRefCounted (this); return PackageFile_Exists (handle, fileName); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern PackageEntry* PackageFile_GetEntry (IntPtr handle, string fileName); /// /// Return the file entry corresponding to the name, or null if not found. This will be case-insensitive on Windows and case-sensitive on other platforms. /// public PackageEntry* GetEntry (string fileName) { Runtime.ValidateRefCounted (this); return PackageFile_GetEntry (handle, fileName); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr PackageFile_GetName (IntPtr handle); /// /// Return the package file name. /// private string GetName () { Runtime.ValidateRefCounted (this); return Marshal.PtrToStringAnsi (PackageFile_GetName (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern int PackageFile_GetNameHash (IntPtr handle); /// /// Return hash of the package file name. /// private StringHash GetNameHash () { Runtime.ValidateRefCounted (this); return new StringHash (PackageFile_GetNameHash (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint PackageFile_GetNumFiles (IntPtr handle); /// /// Return number of files. /// private uint GetNumFiles () { Runtime.ValidateRefCounted (this); return PackageFile_GetNumFiles (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint PackageFile_GetTotalSize (IntPtr handle); /// /// Return total size of the package file. /// private uint GetTotalSize () { Runtime.ValidateRefCounted (this); return PackageFile_GetTotalSize (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint PackageFile_GetTotalDataSize (IntPtr handle); /// /// Return total data size from all the file entries in the package file. /// private uint GetTotalDataSize () { Runtime.ValidateRefCounted (this); return PackageFile_GetTotalDataSize (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint PackageFile_GetChecksum (IntPtr handle); /// /// Return checksum of the package file contents. /// private uint GetChecksum () { Runtime.ValidateRefCounted (this); return PackageFile_GetChecksum (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool PackageFile_IsCompressed (IntPtr handle); /// /// Return whether the files are compressed. /// private bool IsCompressed () { Runtime.ValidateRefCounted (this); return PackageFile_IsCompressed (handle); } public override StringHash Type { get { return UrhoGetType (); } } public override string TypeName { get { return GetTypeName (); } } [Preserve] public static StringHash TypeStatic { get { return GetTypeStatic (); } } public static string TypeNameStatic { get { return GetTypeNameStatic (); } } /// /// Return the package file name. /// public string Name { get { return GetName (); } } /// /// Return hash of the package file name. /// public StringHash NameHash { get { return GetNameHash (); } } /// /// Return number of files. /// public uint NumFiles { get { return GetNumFiles (); } } /// /// Return total size of the package file. /// public uint TotalSize { get { return GetTotalSize (); } } /// /// Return total data size from all the file entries in the package file. /// public uint TotalDataSize { get { return GetTotalDataSize (); } } /// /// Return checksum of the package file contents. /// public uint Checksum { get { return GetChecksum (); } } /// /// Return whether the files are compressed. /// public bool Compressed { get { return IsCompressed (); } } } }