string to const char* for popen()

This page summarizes the projects mentioned and recommended in the original post on /r/cpp_questions

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • native-messaging

  • // C++ Native Messaging host // https://browserext.github.io/native-messaging/ // https://developer.chrome.com/docs/apps/nativeMessaging/ // https://discourse.mozilla.org/t/webextension-with-native-messaging-c-app-side/30821 // https://github.com/nlohmann/json \#include \#include "json.hpp" using namespace std; using namespace nlohmann; struct message\_t { string content; uint32\_t length; }; // Read a message from stdin and decode it. json get\_message() { char raw\_length\[4\]; fread(raw\_length, 4, sizeof(char), stdin); uint32\_t message\_length = \*reinterpret\_cast(raw\_length); if (!message\_length) {

  • webextensions-examples

    Example Firefox add-ons created using the WebExtensions API

  • I found WebExtension with Native messaging C++ App side where the C++ design is similar to the Python design in Fix native message examples with python3 #157 that I have been using capture_system_audio.py.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • json_test_data

    Test data for nlohmann/json

  • // C++ Native Messaging host // https://browserext.github.io/native-messaging/ // https://developer.chrome.com/docs/apps/nativeMessaging/ // https://discourse.mozilla.org/t/webextension-with-native-messaging-c-app-side/30821 // https://github.com/nlohmann/json \#include \#include "json.hpp" using namespace std; using namespace nlohmann; struct message\_t { string content; uint32\_t length; }; // Read a message from stdin and decode it. json get\_message() { char raw\_length\[4\]; fread(raw\_length, 4, sizeof(char), stdin); uint32\_t message\_length = \*reinterpret\_cast(raw\_length); if (!message\_length) {

  • captureSystemAudio

    Capture system audio ("What-U-Hear")

  • I found WebExtension with Native messaging C++ App side where the C++ design is similar to the Python design in Fix native message examples with python3 #157 that I have been using capture_system_audio.py.

  • libdatachannel

    C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets

  • exit(EXIT_SUCCESS); } char message[message_length]; fread(message, message_length, sizeof(char), stdin); string m(message, message + sizeof message / sizeof message[0]); return json::parse(m); } // Encode a message for transmission, given its content. message_t encode_message(json content) { string encoded_content = content.dump(); message_t m; m.content = encoded_content; m.length = (uint32_t)encoded_content.length(); return m; } // Send an encoded message to stdout. void send_message(message_t encoded_message) { char *raw_length = reinterpret_cast(&encoded_message.length); fwrite(raw_length, 4, sizeof(char), stdout); fwrite(encoded_message.content.c_str(), encoded_message.length, sizeof(char), stdout); fflush(stdout); } int main(int argc, char *argv[]) { while (true) { json message = get_message(); auto command = message.get(); // https://github.com/paullouisageneau/libdatachannel/issues/544#issuecomment-1024739214 // https://www.reddit.com/r/cpp\_questions/comments/swr1tk/comment/hxral9f/ FILE *pipe = popen(command.c_str(), "r"); while (true) { size_t bufferSize = 1024; byte buffer[bufferSize]; size_t count; while ((count = fread(buffer, 1, bufferSize, pipe)) > 0) { stringstream data; // S16NE PCM from parec to integers in JSON array data << "["; for (size_t i = 0; i < count; i++) { data << (int)buffer[i]; if (i < count - 1) { data << ","; } } data << "]"; // send JSON array to Native Messaging local client send_message(encode_message(data.str())); } } } }

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Who uses node executable without using npm?

    7 projects | /r/node | 21 Aug 2022
  • Simplicity of IRC

    4 projects | news.ycombinator.com | 13 Mar 2024
  • Example Firefox add-ons created using the WebExtensions API

    1 project | news.ycombinator.com | 4 Feb 2024
  • OBS merges AV1 support for WebRTC

    2 projects | news.ycombinator.com | 28 Jan 2024
  • I spent two years building a desktop environment that runs in the browser, it's finally in beta!

    6 projects | /r/programming | 9 Jul 2023