Coder Social home page Coder Social logo

Comments (1)

ToruNiina avatar ToruNiina commented on May 28, 2024 1

It is a valid multi-line string and is equivalent to the value you expected. (cf. https://toml.io/en/v1.0.0#string)
The default toml11 serializer uses multi-line version if the length exceeds the maximum width (the threshold is a bit fuzzy, though).

You can change max width by

const std::string configString = toml::format(data, 200);

And then it works as you expected.

By the way, TOML has another form of string called literal string (also explained in https://toml.io/en/v1.0.0#string) that is suitable for the case where many backslashes exist. You can use literal string by passing an enum class string_t to toml::string constructor.

const toml::value data{ { {"exePath", toml::string(sExePath, toml::string_t::literal)} } };

Then you will get the following.

exePath = 'C:\Users\ifexception\source\repos\Toml11FilePathsMre\x64\Debug\Toml11FilePathsMre.exe'

from toml11.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.