Code forensics  0.1
Generate historical information about code changes
git_ir.hpp File Reference
#include <cassert>
#include <sqlite_orm/sqlite_orm.h>
#include <concepts>
#include <iostream>
#include <filesystem>
#include <unordered_map>
#include "common.hpp"
#include "dod_base.hpp"
Include dependency graph for git_ir.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sqlite_orm::type_printer< T >
 
struct  sqlite_orm::statement_binder< T >
 
struct  sqlite_orm::field_printer< T >
 
struct  sqlite_orm::row_extractor< T >
 
struct  dod::id_type< Str >
 
struct  ir::FilePath
 file path with associated parent directory information More...
 
struct  ir::EditedFile
 
struct  ir::RenamedFile
 
struct  ir::Commit
 single commit by author, taken at some point in time More...
 
struct  ir::File
 single version of the file that appeared in some commit More...
 
struct  ir::Directory
 Full directory path and it's parent ID. More...
 
struct  ir::String
 Table of interned stirngs for different purposes. More...
 
struct  ir::Author
 Author - name and email found during the source code analysis. More...
 
struct  ir::LineData
 Unique combination of author+time+content for some line in database. More...
 
struct  ir::content_manager
 Main store for repository analysis. More...
 
struct  ir::orm_file
 ORM wrapper for the file data. More...
 
struct  ir::orm_commit
 ORM wrapper for the commit data. More...
 
struct  ir::orm_dir
 ORM wrapper for the directory data. More...
 
struct  ir::orm_string
 ORM wrapper for the string data. More...
 
struct  ir::orm_author
 ORM wrapper for the author data. More...
 
struct  ir::orm_line
 ORM wrapper for the line data. More...
 
struct  ir::orm_lines_table
 ORM wrapper for the file lines data ir::File::lines. More...
 
struct  ir::orm_edited_files
 
struct  ir::orm_renamed_file
 
struct  ir::orm_file_path
 

Namespaces

 sqlite_orm
 
 ir
 
 dod
 

Macros

#define MAKE_HASHABLE(__type, __varname, ...)
 Declare boilerplate type hasing using list of fields. More...
 

Typedefs

using ir::DbConnection = decltype(create_db(""))
 Database connection type alias. More...
 

Functions

template<dod::IsIdType T>
auto operator<< (std::ostream &stream, T id) -> std::ostream &
 
 ir::DECL_ID_TYPE (LineData, LineId, std::size_t)
 
 ir::DECL_ID_TYPE (Commit, CommitId, std::size_t)
 
 ir::DECL_ID_TYPE (File, FileId, std::size_t)
 
 ir::DECL_ID_TYPE (FilePath, FilePathId, std::size_t)
 
 ir::DECL_ID_TYPE (Directory, DirectoryId, std::size_t)
 
 ir::DECL_ID_TYPE (String, StringId, std::size_t)
 
 ir::DECL_ID_TYPE (Author, AuthorId, int)
 
void hash_combine (std::size_t &seed)
 
template<typename T , typename... Rest>
void hash_combine (std::size_t &seed, const T &v, Rest... rest)
 Mix list of hashes. More...
 
 MAKE_HASHABLE (ir::Author, it, it.name, it.email)
 
 MAKE_HASHABLE (ir::LineData, it, it.author, it.time, it.content)
 
 MAKE_HASHABLE (ir::Directory, it, it.name, it.parent)
 
 MAKE_HASHABLE (ir::String, it, it.text)
 
 MAKE_HASHABLE (ir::FilePath, it, it.path)
 
void ir::exec (sqlite3 *db, Str query)
 
auto ir::create_db (CR< Str > storagePath)
 Instantiate database connection. More...
 

Macro Definition Documentation

◆ MAKE_HASHABLE

#define MAKE_HASHABLE (   __type,
  __varname,
  ... 
)
Value:
namespace std { \
template <> \
struct hash<__type> { \
auto operator()(const __type& __varname) const \
-> std::size_t { \
std::size_t ret = 0; \
hash_combine(ret, __VA_ARGS__); \
return ret; \
} \
}; \
}

Declare boilerplate type hasing using list of fields.

Function Documentation

◆ hash_combine() [1/2]

void hash_combine ( std::size_t &  seed)
inline

◆ hash_combine() [2/2]

template<typename T , typename... Rest>
void hash_combine ( std::size_t &  seed,
const T &  v,
Rest...  rest 
)
inline

Mix list of hashes.

◆ MAKE_HASHABLE() [1/5]

MAKE_HASHABLE ( ir::Author  ,
it  ,
it.  name,
it.  email 
)

◆ MAKE_HASHABLE() [2/5]

MAKE_HASHABLE ( ir::Directory  ,
it  ,
it.  name,
it.  parent 
)

◆ MAKE_HASHABLE() [3/5]

MAKE_HASHABLE ( ir::FilePath  ,
it  ,
it.  path 
)

◆ MAKE_HASHABLE() [4/5]

MAKE_HASHABLE ( ir::LineData  ,
it  ,
it.  author,
it.  time,
it.  content 
)

◆ MAKE_HASHABLE() [5/5]

MAKE_HASHABLE ( ir::String  ,
it  ,
it.  text 
)

◆ operator<<()

template<dod::IsIdType T>
auto operator<< ( std::ostream &  stream,
id 
) -> std::ostream&
std
Definition: git_interface.hpp:165