HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Files | Data Structures | Enumerations | Functions
File handling utilities.

Files

file  file.hpp
 Defines the file class.
 
file  file_view.hpp
 Defines the file_view class.
 
file  resource_view.hpp
 Defines resource_view.
 

Data Structures

class  hi::v1::file
 A File object. More...
 
class  hi::v1::file_view
 Map a file into virtual memory. More...
 
class  hi::v1::const_resource_view
 A read-only view of a resource. More...
 
class  hi::v1::URI
 A Uniform Resource Identifier. More...
 
class  hi::v1::URL
 Universal Resource Locator. More...
 

Enumerations

enum class  hi::v1::access_mode {
  hi::v1::access_mode::read = 0x1 , hi::v1::access_mode::write = 0x2 , hi::v1::access_mode::rename = 0x4 , hi::v1::access_mode::read_lock = 0x10 ,
  hi::v1::access_mode::write_lock = 0x20 , hi::v1::access_mode::open = 0x100 , hi::v1::access_mode::create = 0x200 , hi::v1::access_mode::truncate = 0x400 ,
  hi::v1::access_mode::random = 0x1000 , hi::v1::access_mode::sequential = 0x2000 , hi::v1::access_mode::no_reuse = 0x4000 , hi::v1::access_mode::write_through = 0x8000 ,
  hi::v1::access_mode::create_directories = 0x10000 , hi::v1::access_mode::open_for_read = open | read , hi::v1::access_mode::open_for_read_and_write = open | read | write , truncate_or_create_for_write = create_directories | open | create | truncate | write
}
 The mode in which way to open a file. More...
 
enum class  hi::v1::seek_whence { hi::v1::seek_whence::begin , hi::v1::seek_whence::current , hi::v1::seek_whence::end }
 The position in the file to seek from. More...
 

Functions

hi_export generator< std::filesystem::path > hi::v1::glob (glob_pattern pattern) noexcept
 Find paths on the filesystem that match the glob pattern.
 

Detailed Description

This module contains file handling utilities:

File and file-views

file is a RAII object holding an handle to an open file. You can use access_mode flags to control how a file is opened:

A file_view is a RAII object holding a memory-mapping of the file. This object allows easy and fast access to the data in a file, as-if the file was a std::span<> or std::string_view.

Enumeration Type Documentation

◆ access_mode

enum class hi::v1::access_mode
strong

The mode in which way to open a file.

These flags can be combined by using OR.

Enumerator
read 

Allow read access to a file.

write 

Allow write access to a file.

rename 

Allow renaming an open file.

read_lock 

Lock the file for reading, i.e. shared-lock.

write_lock 

Lock the file for writing, i.e. exclusive-lock.

open 

Open file if it exist, or fail.

create 

Create file if it does not exist, or fail.

truncate 

After the file has been opened, truncate it.

random 

Hint the data should not be prefetched.

sequential 

Hint that the data should be prefetched.

no_reuse 

Hint that the data should not be cached.

write_through 

Hint that writes should be send directly to disk.

create_directories 

Create directory hierarchy, if the file could not be created.

open_for_read 

Default open a file for reading.

open_for_read_and_write 

Default open a file for reading and writing.

◆ seek_whence

enum class hi::v1::seek_whence
strong

The position in the file to seek from.

Enumerator
begin 

Start from the beginning of the file.

current 

Continue from the current position.

end 

Start from the end of the file.

Function Documentation

◆ glob()

hi_export generator< std::filesystem::path > hi::v1::glob ( glob_pattern pattern)
inlinenoexcept

Find paths on the filesystem that match the glob pattern.

Parameters
patternThe pattern to search the filesystem for.
Returns
a generator yielding paths to objects on the filesystem that match the pattern.