Skip to content

Proof of concept for auto debug operator creation.

Notifications You must be signed in to change notification settings

aaqsr/cpp-gen-print

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proof of concept for generating debug print operators from classes defined in header. Parsing C++ is difficult, so instead we get around that by making Doxygen do it for us. The resultant XML file is used by the python script to autogenerate the include/generated_debug_operators.hpp file.

Building and Running

Run make and then run ./debug_app.

Example

Currently the repo is set to generate the header

#pragma once
#include <ostream>
#include "person.hpp"

inline std::ostream& operator<<(std::ostream& os, const Person& obj)
{
    os << "Person{";
    os << "age=" << obj.age;
    os << ", name=" << obj.name;
    os << ", height=" << obj.height;
    os << "}";
    return os;
}

from the classes defined in the project (which is just Person).

About

Proof of concept for auto debug operator creation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published