mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-13 20:23:37 +08:00
25 lines
416 B
C++
25 lines
416 B
C++
#pragma once
|
|
|
|
|
|
#include <sstream>
|
|
#include <fstream>
|
|
#include <memory>
|
|
#include "../../DesktopEditor/common/Types.h"
|
|
|
|
namespace CFCPP
|
|
{
|
|
using Stream = std::shared_ptr<std::iostream>;
|
|
std::streamsize Length(const Stream& st)
|
|
{
|
|
if (st.get() == nullptr)
|
|
return 0;
|
|
|
|
auto curPos = st->tellg();
|
|
st->seekg(std::ios_base::end);
|
|
auto ssize = st->tellg();
|
|
st->seekg(curPos);
|
|
|
|
return ssize;
|
|
}
|
|
}
|