GithubHelp home page GithubHelp logo

stringify's Introduction

stringify :- pretty print stl containers

  • can print all stl containers to output stream_

Build Status

Build Status
AppVeyor Build status
Travis Build Status

install

copy include/stringify.hpp to your source tree

local build

git clone https://github.com/asit-dhal/stringify
cd stringify
mkdir build 
cd build

for windows(Visual Studio 2015) build

cmake -G"Visual Studio 14 2015 Win64" ..

for linux

cmake ..

Usages

#include "stringify\stringify.hpp"
using namespace stringify;
std::vector<int> v1;
for (auto i = 0; i < 10; i++)
    v1.push_back(i);
std::cout << "vector<int>: " << v1 << std::endl;

If you don't want to include namespace, you can use stringify::to_string()

#include "stringify\stringify.hpp"
std::vector<int> v1;
for (auto i = 0; i < 10; i++)
    v1.push_back(i);
std::cout << "vector<int>: " << stringify::to_string(v1) << std::endl;

Print Format

container format example
std::string, const char* within double quote "dummy"
char, wchar_t within single quote 'a'
std::array<int, N> arr_len_[ comma separated values] arr5[1, 2, 3, 4, 5]
int [] carr_len_[ comma separated values] carr5[1, 2, 3, 4, 5]
std::deque<int> deq_len_ [comma separated values] deq5[1, 2, 3, 4, 5]
std::queue<int> qu_len_ [comma separated values] qu5[1, 2, 3, 4, 5]
std::list<int> lst_len_[comma separated values] lst5[1, 2, 3, 4, 5]
std::forward_list<int> flst_len_[comma separated values] flst5[1, 2, 3, 4, 5]
std::set<int> set_len_(comma separated values) set5(1, 2, 3, 4, 5)
std::multiset<int> mset_len_(comma separated values) mset5(1, 2, 3, 4, 5)
std::map<int, std::string> map_len_[python style dictionary] map4{1:"one", 2:"two", 3:"three", 4:"four"}
std::multimap<int, std::string> mmap_len_[python style dictionary] map4{1:"one", 1:"ekka", 2:"two", 2:"dui", 3:"three", 4:"four"}
std::pair<int, std::string> pr(comma separated values) pr(200, "two hundred")
tuple<int, std::string, char*, float> tp_len_(comma separated values) tp4(200, "two hundred", "make string", 2.3)

stringify's People

Contributors

asit-dhal avatar gracicot avatar nlohmann avatar

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.