1
// Copyright © 2017-2020 Trust Wallet.
2
//
3
// This file is part of Trust. The full Trust copyright notice, including
4
// terms governing use, modification, and redistribution, is contained in the
5
// file LICENSE at the root of the source code distribution tree.
6

7
#pragma once
8

9
#include <string>
10
#include <iostream>
11

12
namespace TW::WalletConsole {
13

14
using namespace std;
15

16
class Util {
17
protected:
18
    ostream& _out;
19
    
20
public:
21 1
    Util(ostream& out) : _out(out) {} 
22
    static bool hex(const string& p, string& res);
23
    bool base64Encode(const string& p, string& res);
24
    bool base64Decode(const string& p, string& res);
25
    /// Write to file
26
    bool fileW(const string& fileName, const string& data, string& res);
27
    /// Read from file
28
    bool fileR(const string& fileName, string& res);
29

30
    // Parse string into words
31
    static vector<string> tokenize(const string& line);
32
    // trim from start (in place)
33
    static void trimLeft(std::string& s);
34
    static void toLower(std::string& s);
35
    static bool fileExists(const std::string& fileName);
36
};
37

38
} // namespace TW::WalletConsole

Read our documentation on viewing source code .

Loading