cppan / tests

1 stars 0 forks source link

Sery at CPPAN #1

Closed egorpugin closed 7 years ago

egorpugin commented 7 years ago

Hi @Ninetainedo,

I've added your library to C++ Archive Network. https://cppan.org/ https://cppan.org/pvt.cppan.demo.ninetainedo.sery/version/1.0.0 If you like to add it under your namespace, e.g. pvt.ninetainedo.sery, feel free to register there and add it yourself. (See spec file contents on the bottom of the sery webpage.)

Quick example:

  1. Download cppan client.
  2. Create a file sery.cpp with contents below.
  3. Run cppan --build sery.cpp
  4. Test it!
/*
local_settings:
    build:
        cxx_flags: -std=c++11
dependencies:
    pvt.cppan.demo.ninetainedo.sery: 1
*/

#include <Sery/Buffer.hh>
#include <Sery/Stream.hh>
#include <fstream>

int             main()
{
  Sery::Buffer  buffer;
  Sery::Stream  stream(buffer, Sery::LittleEndian);
  std::ofstream file("BinaryFile", std::ofstream::binary);
  Sery::int32   magic = 0x11223344;
  std::string   str("Hello world!");

  stream << magic << str;
  file.write(buffer.data(), buffer.size());
  file.close();
}

More than that with cppan you can include dependencies into existing CMake project build system infrastructure.

Telokis commented 7 years ago

Hey @egorpugin ! Thanks for your message, your tool is pretty nice ! I just registered myself and Sery : https://cppan.org/pvt.ninetainedo.sery/version/1.0.0

egorpugin commented 7 years ago

Nice, thanks! Did you try the example?


ps. In case if you see some errors during example building. I've just updated clients on the website, so the example from my first post should work now. You can try to re-download client manually or run cppan --self-upgrade (or sudo cppan --self-upgrade).

Telokis commented 7 years ago

I tried the example from the post above. I just changed pvt.cppan.demo.ninetainedo.sery to pvt.ninetainedo.sery to check if my version was properly set up and that worked quite well.

egorpugin commented 7 years ago

Ok, nice to hear. I'm closing this ticket. Feel free to add more of your stuff to CPPAN and share with friends and colleagues.