Skip to content

Commit

Permalink
Fix vs14 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jszczerbinski committed Nov 6, 2024
1 parent b596e7d commit 72de494
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions cpp/lib/CacheFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace Client {

}

std::optional<std::string> findCacheDirRoot() {
boost::optional<std::string> findCacheDirRoot() {
for (auto const &envVar: CACHE_ROOT_ENV_VARS)
{
char *root = getenv(envVar.c_str());
Expand All @@ -69,7 +69,7 @@ namespace Client {
return {};
}

std::optional<std::string> getCredentialFilePath()
boost::optional<std::string> getCredentialFilePath()
{
const auto cacheDirRootOpt = findCacheDirRoot();
if (!cacheDirRootOpt)
Expand Down Expand Up @@ -194,7 +194,7 @@ namespace Client {
}
}

std::optional<std::string> cacheFileGet(picojson::value &cache, const CredentialKey &key) {
boost::optional<std::string> cacheFileGet(picojson::value &cache, const CredentialKey &key) {
ensureObject(cache);
picojson::object &cacheObj = cache.get<picojson::object>();

Expand Down
4 changes: 2 additions & 2 deletions cpp/lib/CacheFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Snowflake {

namespace Client {

std::optional<std::string> getCredentialFilePath();
boost::optional<std::string> getCredentialFilePath();

std::string readFile(const std::string &path, picojson::value &result);

Expand All @@ -22,7 +22,7 @@ namespace Client {

void cacheFileRemove(picojson::value &cache, const CredentialKey &key);

std::optional<std::string> cacheFileGet(picojson::value &cache, const CredentialKey &key);
boost::optional<std::string> cacheFileGet(picojson::value &cache, const CredentialKey &key);

}

Expand Down
4 changes: 2 additions & 2 deletions cpp/lib/CredentialCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Client {
class FileCredentialCache : public CredentialCache {
public:

std::optional<std::string> get(const CredentialKey& key) override
boost::optional<std::string> get(const CredentialKey& key) override
{
auto pathOpt = getCredentialFilePath();
if (!pathOpt)
Expand Down Expand Up @@ -125,7 +125,7 @@ namespace Client {

class SecureStorageCredentialCache : public CredentialCache {
public:
std::optional<std::string> get(const CredentialKey &key) override {
boost::optional<std::string> get(const CredentialKey &key) override {
return storage.retrieveToken(key.host, key.user, credTypeToString(key.type));
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/lib/CredentialCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <string>
#include <memory>
#include <optional>
#include <boost/optional.hpp>

#include "snowflake/mfa_token_cache.h"

Expand All @@ -26,7 +26,7 @@ namespace Client {
public:
static CredentialCache *make();

virtual std::optional<std::string> get(const CredentialKey &key) = 0;
virtual boost::optional<std::string> get(const CredentialKey &key) = 0;

virtual bool save(const CredentialKey &key, const std::string &credential) = 0;

Expand Down
2 changes: 1 addition & 1 deletion cpp/platform/SecureStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Client {
return true;
}

std::optional<std::string> SecureStorage::retrieveToken(const std::string& host,
boost::optional<std::string> SecureStorage::retrieveToken(const std::string& host,
const std::string& username,
const std::string& credType)
{
Expand Down
4 changes: 2 additions & 2 deletions cpp/platform/SecureStorage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <cstdlib>
#include <string>
#include <optional>
#include <boost/optional.hpp>


namespace Snowflake {
Expand Down Expand Up @@ -53,7 +53,7 @@ namespace Client {
* @param tokenLen - on return, length of the credential retrieved
* @return True / False
*/
std::optional<std::string> retrieveToken(const std::string& host,
boost::optional<std::string> retrieveToken(const std::string& host,
const std::string& username,
const std::string& credType);

Expand Down
2 changes: 1 addition & 1 deletion cpp/platform/SecureStorageWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ namespace Client
std::copy(
retcreds->CredentialBlob,
retcreds->CredentialBlob + blobSize,
std::back_inserter(token)
std::back_insert_iterator<std::string>(token)
);

CXX_LOG_DEBUG("Copied token");
Expand Down

0 comments on commit 72de494

Please sign in to comment.