text: #include "utils/logged_fstream.hpp"
  
  namespace devilution {
  
  const char *LoggedFStream::DirToString(std::ios::seekdir dir)
  {
  	switch (dir) {
  	case std::ios::beg:
  		return "std::ios::beg";
  	case std::ios::end:
  		return "std::ios::end";
  	case std::ios::cur:
  		return "std::ios::cur";
  	default:
  		return "invalid";
  	}
  }
  
  std::string LoggedFStream::OpenModeToString(std::ios::openmode mode)
  {
  	std::string result;
  	if ((mode & std::ios::app) != 0)
  		result.append("std::ios::app | ");
  	if ((mode & std::ios::ate) != 0)
  		result.append("std::ios::ate | ");
  	if ((mode & std::ios::binary) != 0)
  		result.append("std::ios::binary | ");
  	if ((mode & std::ios::in) != 0)
  		result.append("std::ios::in | ");
  	if ((mode & std::ios::out) != 0)
  		result.append("std::ios::out | ");
  	if ((mode & std::ios::trunc) != 0)
  		result.append("std::ios::trunc | ");
  	if (!result.empty())
  		result.resize(result.size() - 3);
  	return result;
  }
  
  } // namespace devilution
  