Is it possible to use [[NSProcessInfo processInfo] operatingSystemVersion] from C++ or C and how do I do that?
Using NSProcessInfo from C++
3.2k Views Asked by Simon Warta At
1
There are 1 best solutions below
Related Questions in C++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in MACOS
- Error installing Nativescript on Mac M2 Sonoma 14.4.1
- macOS - Most secure way of a GUI SUDO_ASKPASS
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- ZSH function parameters conundrum
- how to make read only file/directory in Mac writable
- macOS BigSur - Unable to run bundled php version or brew php 8
- 9 Digit Addresses in Hexadecimal System in MacOS
- MacOS Bash-Script: while read p and echo
- How to make a range for tail rows on a categorized table in Numbers with JXA scripts?
- Cannot build a basic project with curl on Mac (M2) for Raspberry Pi Pico
- How to recover deleted files from create vite react project
- Can't run built SFML project from Xcode template
- React Native - RealmJS - Linker command failed with exit code 1
- How can I manually add a keyboard shortcut to a Shortcut Action Service directly via the system files, without going through the System Prefs GUI?
Related Questions in COCOA
- In what context can we use an unqualified #selector() expression in Swift?
- How can I trigger macOS system gamepad API based on a value received from iOS app through core bluetooth
- Using sort descriptors in Outline View
- NSTableView to NSOutlineView Drag & Drop not accepting drop
- How to remove horizontal line in bottom of section NSTableView?
- CGSRegionRef: How is an arbitrary region represented as union of rects?
- Listen for Touch Events on MacOS (Trackpad)
- Window "yanks" when moving
- Writing NSFilePromiseProviders to pasteboard blocks app on quit
- Basic ImGui program doesn't render, leaks memory and crashes
- NSTokenField suggestion using context menu in swift
- How to link multiple text views to a single text storage in TextKit 2
- I would like to know why I’m not getting IBOutlets connected in an App’s window
- How to make a custom event loop in Cocoa?
- Why is restoreWindow(withIdentifier:state:) called after applicationDidFinishLaunching(_:)?
Related Questions in FOUNDATION
- VolumeUnit conversion from quarts to cups seems off
- NSThread initWithTarget:selector:object:]: target does not implement selector ((null))'
- Do we have a list of NSURL Error Code Values given by Apple somewhere?
- How Do I Migrate a large Rails 6/7 App from Zurb Foundation to Bootstrap 5?
- How to easily format UnitVolume for metric and imperial usage in Swift
- Get Application Scripts directory for app group
- Unable to connect to POP3 server swift
- Why is fcopyfile faster than copyfile?
- Swift, Foundation, Combine
- Is it safe to assume that the initializer URLComponents(url:resolvingAgainstBaseURL:) never returns nil?
- Making filecopy faster by changing block size
- How to get a card to match the height of the card next to it
- In Swift, why does Calendar nextDate/enumerateDates methods with backward direction does not provide a date before September 1995?
- In Swift, how can I get the "last Sunday of a month before the current date"?
- Xcode warning for call to DispatchQueue.main.sync: Call to method 'asd' in closure requires explicit use of 'self' to make capture semantics explicit
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
In XCode and Objective-C, files with extension
.mmare treated as "mixed" in the sense that one single file can contain C++/C notion as well as Objective-C code, and that even C++/C function implementations can access Objective-C classes and send messages to them.Such a
.mm-files can then provide a trampoline function, i.e. a C-style function that is exposed and can then be used in pure C++/C-files (extension.cpp, where Objective-C code must not occur).Let's consider the following setting:
ProcessInfoProvider.mm, which calls[[NSProcessInfo processInfo] operatingSystemVersion]and provides the result in a C-style functionstd::string getProcessInfoVersion_C(),UseProcessInfoInC.cpp/hppdefining a classMyCppProcessInfo, which provides aprintVersion()-member function and which usesgetProcessInfoVersion_C,MyCppProcessInfoand calls member functionprintVersion()Let's start with
ProcessInfoProvider.mm:Note that
getProcessInfoVersion_Cis a C-style function but contains objective-C code in it's implementation.Then, pure C++ files
UseProcessInfoInC.cpp/hppimplement classMyCppProcessInfo:and
Note that these two files do not contain any Objective-C-stuff. Finally, let's try out
MyCppProcessInfo, e.g. in a functionmain():