Skip to content

Simple C++ library for parsing and updating steam shortcuts and controller configs.

License

Notifications You must be signed in to change notification settings

Nikorag/cpp-steam-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-steam-tools

Simple C++ library for parsing and updating steam shortcuts and controller configs.

Requirements

cpp-steam-tools relies on QT6 being included in your project

Installation

The easiest way to include cpp-steam-tools in your CMake project is to use FetchContent

include(FetchContent)

FetchContent_Declare(
        cpp-steam-tools
        GIT_REPOSITORY https://github.com/nikorag/cpp-steam-tools.git
        GIT_TAG main #this can be any tag, revision or branch
)
FetchContent_GetProperties(cpp-steam-tools)

if(NOT cpp-steam-tools_POPULATED)
    message(STATUS "Fetching cpp-steam-tools...")
    FetchContent_Populate(cpp-steam-tools)
    add_subdirectory(${cpp-steam-tools_SOURCE_DIR} ${cpp-steam-tools_BINARY_DIR})
endif()

target_link_libraries(<YOUR PROJECT NAME> PUBLIC cpp-steam-tools)

Usage

The SteamTools object must be instantiated with lamba functions for logging info and error:

//Create steam tools
auto infoLambda = [this](const QString &infoMessage) {
    std::cout << infoMessage.toStdString() << std::endl;
};

auto errorLambda = [this](const QString &errorMessage) {
    std::cerr << errorMessage.toStdString() << std::endl;
};
SteamTools* steam_tools = new SteamTools(infoLambda, errorLambda);

The SteamTools object provides methods for:

  • Checking if Steam is installed
steamTools->steamExists()
  • Reading a shortcuts.vdf file
steamTools->parseShortcuts()
  • Creating new shortcut entries
steamTools->buildShortcutEntry("appName", "/path/to/my/exe", "launchOptions", mapOfArtwork)
  • Writing entries back to shortcuts.vdf
steamTools->updateShortcuts(lsitOfShortcuts)
  • Setting the neptune controller config for a shortcut
steamTools->updateControllerConfig("AppName", "ControllerConfigId")

Acknowledgements

About

Simple C++ library for parsing and updating steam shortcuts and controller configs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published