CA: Globals: Introduce global CAssetsDir gAssetsDir

This commit is contained in:
Jorge Timón 2017-03-08 09:42:52 +01:00 committed by Gregory Sanders
parent b1a065e6c3
commit bd48b5ed7b
3 changed files with 34 additions and 0 deletions

View file

@ -95,6 +95,7 @@ BITCOIN_CORE_H = \
consensus/consensus.h \
core_io.h \
core_memusage.h \
global/common.h \
httprpc.h \
httpserver.h \
indirectmap.h \
@ -307,6 +308,7 @@ libbitcoin_common_a_SOURCES = \
compressor.cpp \
core_read.cpp \
core_write.cpp \
global/common.cpp \
key.cpp \
keystore.cpp \
merkleblock.cpp \

15
src/global/common.cpp Normal file
View file

@ -0,0 +1,15 @@
// Copyright (c) 2017-2017 The Elements Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "global/common.h"
#include "assetsdir.h"
CAssetsDir _gAssetsDir;
const CAssetsDir& gAssetsDir = _gAssetsDir;
void InitGlobalAssetDir(const std::vector<std::string>& assetsToInit)
{
_gAssetsDir.InitFromStrings(assetsToInit);
}

17
src/global/common.h Normal file
View file

@ -0,0 +1,17 @@
// Copyright (c) 2017-2017 The Elements Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_GLOBAL_COMMON_H
#define BITCOIN_GLOBAL_COMMON_H
#include <string>
#include <vector>
class CAssetsDir;
extern const CAssetsDir& gAssetsDir;
void InitGlobalAssetDir(const std::vector<std::string>& assetsToInit);
#endif // BITCOIN_GLOBAL_COMMON_H