undoStudio
The IDE of the undoRT ecosystem
Loading...
Searching...
No Matches
undoStudio::core Namespace Reference

Namespaces

namespace  settings
 

Classes

class  Application
 Main application class for undoStudio. More...
 
struct  PLCConfig
 Configuration entry for a single undoPLC. More...
 
class  PluginManager
 Loads and owns the lifetime of dynamically-loaded undoApp plugins. More...
 
struct  ProjectConfig
 Top-level project metadata. More...
 
class  ProjectManager
 Singleton service that manages the lifecycle of an undoProject. More...
 
class  RecentFiles
 Which files were opened recently. More...
 
struct  TaskConfig
 Configuration for a single undoTask. More...
 

Typedefs

using CreateUndoAppFunc = void *(*)()
 
using DestroyUndoAppFunc = void(*)(void *)
 

Enumerations

enum class  OpenTargetKind { None , Project , File }
 What a path handed to the IDE names. More...
 
enum class  Strictness { Off , On }
 Semantic strictness of a project, as declared in project.json. More...
 
enum class  NodeRole {
  Generic , ProjectRoot , ConfigFolder , ConfigFile ,
  UndoCore , TasksFolder , TaskFile , UndoLogic ,
  SharedLibs , SharedGVLs , SharedDUTs , SharedPOUs ,
  PLCRoot , PLCLibs , PLCGVLs , PLCDUTs ,
  PLCPOUs , ExportsFile , STFile , JSONFile
}
 

Functions

OpenTargetKind classifyOpenTarget (const std::string &path)
 What a single path names.
 
std::vector< std::string > pathsFromCommandLine (int argc, char *const argv[])
 The targets named by a command line, in the order given.
 

Variables

const char *const kProjectConfigDirName = ".undoProject"
 The config folder a project directory holds.
 
static constexpr size_t kDefaultMaxRecentFiles = 10
 

Typedef Documentation

◆ CreateUndoAppFunc

using undoStudio::core::CreateUndoAppFunc = typedef void* (*) ()

◆ DestroyUndoAppFunc

using undoStudio::core::DestroyUndoAppFunc = typedef void (*)(void*)

Enumeration Type Documentation

◆ NodeRole

enum class undoStudio::core::NodeRole
strong
Enumerator
Generic 

Regular file or folder outside a project.

ProjectRoot 

The project root directory.

ConfigFolder 

.undoProject/

ConfigFile 

.undoProject/*.json

UndoCore 

undoCore/

TasksFolder 

undoCore/tasks/

TaskFile 

undoCore/tasks/*.json

UndoLogic 

undoLogic/

SharedLibs 

undoLogic/undoSharedLibs/

SharedGVLs 

undoLogic/undoSharedGVLs/

SharedDUTs 

undoLogic/undoSharedDUTs/

SharedPOUs 

undoLogic/undoSharedPOUs/

PLCRoot 

undoLogic/undoPLC_X/

PLCLibs 

undoLogic/undoPLC_X/undoLibs/

PLCGVLs 

undoLogic/undoPLC_X/undoGVLs/

PLCDUTs 

undoLogic/undoPLC_X/undoDUTs/

PLCPOUs 

undoLogic/undoPLC_X/undoPOUs/

ExportsFile 

undoLogic/undoPLC_X/exports.json

STFile 

Any .st file.

JSONFile 

Any other .json file.

◆ OpenTargetKind

What a path handed to the IDE names.

Enumerator
None 

Nothing usable: empty, or a path that does not exist.

Project 

A project: a directory, or its .undoProject config folder.

File 

A file to open in the editor.

◆ Strictness

enum class undoStudio::core::Strictness
strong

Semantic strictness of a project, as declared in project.json.

On -> Strictness::Strict: the st2cpp analyzer enforces the IEC 61131-3 implicit-conversion rules, so a value-losing or cross-family implicit assignment (e.g. INT := REAL) is reported as an error. Off -> Strictness::Permissive: the analyzer stays permissive and lets the generated C++ static_cast perform the conversion silently.

Enumerator
Off 

Permissive: lossy implicit conversions are not reported.

On 

Strict IEC 61131-3: lossy implicit conversions are errors.

Function Documentation

◆ classifyOpenTarget()

OpenTargetKind undoStudio::core::classifyOpenTarget ( const std::string &  path)

What a single path names.

Parameters
pathThe path as the user wrote it, relative to the working directory or absolute.
Returns
The kind of target, and None for a path that is not there.

A directory is taken for a project. That is what a folder dropped on a window means, and a workspace folder is a project as far as undoStudio is concerned; an ordinary folder is still openable as one.

◆ pathsFromCommandLine()

std::vector< std::string > undoStudio::core::pathsFromCommandLine ( int  argc,
char *const  argv[] 
)

The targets named by a command line, in the order given.

Parameters
argcThe argument count, as handed to main().
argvThe argument vector, as handed to main(); may be null.
Returns
One entry per path that names something, skipping switches.

Switches are anything beginning with a dash, and so is anything after a bare "--", which is where the paths go once something else has taken the switches: undoStudio workspace.proj undoStudio – some/file.st Every path is returned rather than only the first, so that dropping two files at once and passing two files behave the same way.

Variable Documentation

◆ kDefaultMaxRecentFiles

constexpr size_t undoStudio::core::kDefaultMaxRecentFiles = 10
staticconstexpr

Default maximum number of remembered files. Ten matches the project list, and is small enough that the menu does not need a scrollbar on most screens.

◆ kProjectConfigDirName

const char *const undoStudio::core::kProjectConfigDirName = ".undoProject"

The config folder a project directory holds.

A path ending in this is the project itself rather than a folder inside it, because naming either of the two is what a user does and both mean the same thing here.