Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Static Public Member Functions | Static Private Member Functions | List of all members
Olympe::AI::AIEditorFileDialog Class Reference

Wrapper for native file dialog operations. More...

#include <AIEditorFileDialog.h>

Static Public Member Functions

static std::string OpenFile (const std::string &filterList="json,btree", const std::string &defaultPath="")
 Open a native file dialog to select an existing file.
 
static std::string SaveFile (const std::string &filterList="json,btree", const std::string &defaultPath="", const std::string &defaultName="new_ai_graph.json")
 Open a native save file dialog.
 
static std::string OpenFolder (const std::string &defaultPath="")
 Open a native folder selection dialog.
 
static std::string GetLastError ()
 Get last error message from NFD.
 

Static Private Member Functions

static std::string ConvertFiltersToNFD (const std::string &filterList)
 Convert comma-separated filter list to NFD format.
 
static std::string ToNFDString (const std::string &str)
 Convert std::string to native NFD character type.
 
static std::string FromNFDString (const char *str)
 

Detailed Description

Wrapper for native file dialog operations.

Encapsulates NFD (NativeFileDialog-Extended) API calls to provide a simple C++ interface for opening, saving, and folder selection dialogs. All methods are static and thread-safe (NFD handles thread initialization).

Definition at line 33 of file AIEditorFileDialog.h.

Member Function Documentation

◆ ConvertFiltersToNFD()

std::string Olympe::AI::AIEditorFileDialog::ConvertFiltersToNFD ( const std::string &  filterList)
staticprivate

Convert comma-separated filter list to NFD format.

Parameters
filterList"json,btree" -> "json;btree"
Returns
Converted filter string for NFD

Definition at line 90 of file AIEditorFileDialog.cpp.

References GetComponentTypeID_Static().

Referenced by OpenFile(), and SaveFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FromNFDString()

std::string Olympe::AI::AIEditorFileDialog::FromNFDString ( const char str)
staticprivate

Definition at line 77 of file AIEditorFileDialog.cpp.

References GetComponentTypeID_Static().

Referenced by OpenFile(), OpenFolder(), and SaveFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLastError()

std::string Olympe::AI::AIEditorFileDialog::GetLastError ( )
static

Get last error message from NFD.

Returns
Error string or empty if no error

Definition at line 312 of file AIEditorFileDialog.cpp.

References GetComponentTypeID_Static().

+ Here is the call graph for this function:

◆ OpenFile()

std::string Olympe::AI::AIEditorFileDialog::OpenFile ( const std::string &  filterList = "json,btree",
const std::string &  defaultPath = "" 
)
static

Open a native file dialog to select an existing file.

Parameters
filterListComma-separated extensions (e.g., "json,btree")
defaultPathStarting directory (optional)
Returns
Selected file path or empty string if canceled

Definition at line 107 of file AIEditorFileDialog.cpp.

References ConvertFiltersToNFD(), FromNFDString(), GetComponentTypeID_Static(), SYSTEM_LOG, and ToNFDString().

Referenced by Olympe::AI::AIEditorGUI::MenuAction_Open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OpenFolder()

std::string Olympe::AI::AIEditorFileDialog::OpenFolder ( const std::string &  defaultPath = "")
static

Open a native folder selection dialog.

Parameters
defaultPathStarting directory (optional)
Returns
Selected folder path or empty string if canceled

Definition at line 268 of file AIEditorFileDialog.cpp.

References FromNFDString(), GetComponentTypeID_Static(), SYSTEM_LOG, and ToNFDString().

+ Here is the call graph for this function:

◆ SaveFile()

std::string Olympe::AI::AIEditorFileDialog::SaveFile ( const std::string &  filterList = "json,btree",
const std::string &  defaultPath = "",
const std::string &  defaultName = "new_ai_graph.json" 
)
static

Open a native save file dialog.

Parameters
filterListComma-separated extensions
defaultPathStarting directory (optional)
defaultNameSuggested filename (optional)
Returns
Selected save path or empty string if canceled

Definition at line 185 of file AIEditorFileDialog.cpp.

References ConvertFiltersToNFD(), FromNFDString(), GetComponentTypeID_Static(), SYSTEM_LOG, and ToNFDString().

Referenced by Olympe::AI::AIEditorGUI::MenuAction_SaveAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToNFDString()

std::string Olympe::AI::AIEditorFileDialog::ToNFDString ( const std::string &  str)
staticprivate

Convert std::string to native NFD character type.

Parameters
strUTF-8 string
Returns
Platform-specific wide string (Windows) or UTF-8 (Linux/Mac)

Definition at line 72 of file AIEditorFileDialog.cpp.

References GetComponentTypeID_Static().

Referenced by OpenFile(), OpenFolder(), and SaveFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: