Foundation
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
Foundation::Native Namespace Reference

Platform-dependent application abstractions. More...

Classes

class  NativeApplication
 Application base class. Handles initialization and shutdown of the native platform, and windowing management. More...
 
class  NativeWindow
 Class representing a window for the platform. More...
 

Typedefs

using Path = std::filesystem::path
 OS specific filesystem path. Alias of std::filesystem::path.
 
using ByteArray = Core::Vector< char >
 Vector of bytes. Alias of Core::Vector<char>
 
using Bytes = Core::Span< const char >
 Span of bytes. Alias of Core::Span<const char>
 

Enumerations

enum class  MessageBoxType : int { Ok = 0 , OkCancel = 1 , YesNo = 2 , YesNoCancel = 3 }
 
enum class  MessageBoxIcon : int { Info = 0 , Warning = 1 , Error = 2 , Question = 3 }
 
enum class  MessageBoxResult : int { No = 0 , Yes = 1 , Cancel = 2 }
 

Functions

void glfw_error_callback (int error, const char *description)
 
MessageBoxResult CreateMessageBox (const char *title, const char *message, MessageBoxType type=MessageBoxType::Ok, MessageBoxIcon icon=MessageBoxIcon::Info, MessageBoxResult default_result=MessageBoxResult::Yes)
 Creates a message box with the specified title and message.
 
size_t GetFileSize (Path const &path)
 
size_t ReadFile (Path const &path, ByteArray &data)
 Reads the entire contents of a file into a byte vector.
 
size_t WriteFile (Path const &path, Bytes data)
 Writes the entire contents of a byte vector to a file.
 

Detailed Description

Platform-dependent application abstractions.

Typedef Documentation

◆ ByteArray

Vector of bytes. Alias of Core::Vector<char>

◆ Bytes

Span of bytes. Alias of Core::Span<const char>

◆ Path

using Foundation::Native::Path = typedef std::filesystem::path

OS specific filesystem path. Alias of std::filesystem::path.

Enumeration Type Documentation

◆ MessageBoxIcon

Enumerator
Info 
Warning 
Error 
Question 

◆ MessageBoxResult

Enumerator
No 
Yes 
Cancel 

◆ MessageBoxType

Enumerator
Ok 
OkCancel 
YesNo 
YesNoCancel 

Function Documentation

◆ CreateMessageBox()

MessageBoxResult Foundation::Native::CreateMessageBox ( const char title,
const char message,
MessageBoxType  type = MessageBoxType::Ok,
MessageBoxIcon  icon = MessageBoxIcon::Info,
MessageBoxResult  default_result = MessageBoxResult::Yes 
)

Creates a message box with the specified title and message.

This is blocking, and will halt execution until the user dismisses it.

◆ GetFileSize()

size_t Foundation::Native::GetFileSize ( Path const path)
Returns
The size of the file in bytes.

◆ glfw_error_callback()

void Foundation::Native::glfw_error_callback ( int  error,
const char description 
)

◆ ReadFile()

size_t Foundation::Native::ReadFile ( Path const path,
ByteArray data 
)

Reads the entire contents of a file into a byte vector.

Returns
The number of bytes read.

◆ WriteFile()

size_t Foundation::Native::WriteFile ( Path const path,
Bytes  data 
)

Writes the entire contents of a byte vector to a file.

Returns
The number of bytes written.