Sha256: 2d265e5dc5204a8274b32972ecc4b743f5cec42f8f0b79d6db539d9af8226d7e

Contents?: true

Size: 534 Bytes

Versions: 3

Compression:

Stored size: 534 Bytes

Contents

/**
 * Copyright (c) 2016-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#include "utils.h"

#include <ios>

namespace fasttext {

namespace utils {

int64_t size(std::ifstream& ifs) {
  ifs.seekg(std::streamoff(0), std::ios::end);
  return ifs.tellg();
}

void seek(std::ifstream& ifs, int64_t pos) {
  ifs.clear();
  ifs.seekg(std::streampos(pos));
}
} // namespace utils

} // namespace fasttext

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fasttext-0.1.2 vendor/fastText/src/utils.cc
fasttext-0.1.1 vendor/fastText/src/utils.cc
fasttext-0.1.0 vendor/fastText/src/utils.cc