1 /* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
2 * Use of this file is governed by the BSD 3-clause license that
3 * can be found in the LICENSE.txt file in the project root.
6 #include "support/StringUtils.h"
8 #include "ANTLRFileStream.h"
10 using namespace antlr4;
12 void ANTLRFileStream::loadFromFile(const std::string &fileName) {
14 if (_fileName.empty()) {
19 std::ifstream stream(antlrcpp::s2ws(fileName), std::ios::binary);
21 std::ifstream stream(fileName, std::ios::binary);
24 ANTLRInputStream::load(stream);
27 std::string ANTLRFileStream::getSourceName() const {