PRISM
 v0.0.0
Loading...
Searching...
No Matches
BibTexHelper.h
1//* This file is a part of PRISM: Plasma Reaction Input SysteM,
2//* A library for parcing chemical reaction networks for plasma chemistry
3//* https://github.com/NCSU-ComPS-Group/prism
4//*
5//* Licensed under MIT, please see LICENSE for details
6//* https://opensource.org/license/mit
7//*
8//* Copyright 2024, North Carolina State University
9//* ALL RIGHTS RESERVED
10//*
11#pragma once
12#include <string>
13#include <unordered_set>
14#include <unordered_map>
15
16namespace prism
17{
18
23class BibTexHelper
24{
25public:
27 static BibTexHelper & instance();
29 void clear();
35 void checkCiteKey(const std::string & file, const std::string & citekey);
36
37#ifdef TESTING
38 void collectReferences(const std::string & bibfile);
39#endif
40
41private:
43 friend class NetworkParser;
45 BibTexHelper() {}
46
49 BibTexHelper(const BibTexHelper &) = delete;
50 BibTexHelper & operator=(const BibTexHelper &) = delete;
52
54 static BibTexHelper * _instance;
55
60 std::unordered_map<std::string, std::unordered_set<std::string>> _refs;
69
70#ifndef TESTING
79 void collectReferences(const std::string & bibfile);
80#endif
81};
82}
Class for collecting and managing cite keys from the user provided bib files.
Definition BibTexHelper.h:24
static BibTexHelper & instance()
Static function to get the instance of the singleton instance.
Definition BibTexHelper.C:27
void checkCiteKey(const std::string &file, const std::string &citekey)
Checks to see if a cite key belongs to a give bib file.
Definition BibTexHelper.C:83
friend class NetworkParser
the NetworkParser is a friend so that it can call private functions
Definition BibTexHelper.h:43
void clear()
Empties all of the cite keys that are currently in the BibTexHelper.
Definition BibTexHelper.C:37