Commit 437ff29d authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55078 954022d7-b5bf-4e40-9824-e11837661b57
parent bdc9547e
#include "precompiled_cpodf.h"
#include "bool.h"
#include <ostream>
#include <sstream>
namespace cpdoccore { namespace odf {
std::wostream & operator << (std::wostream & _Wostream, const Bool & _Val)
{
_Wostream << _Val.string();
return _Wostream;
}
Bool Bool::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"0" || tmp == L"false") return Bool(false);
else return Bool(true);
}
}
}
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf {
class Bool
{
public:
Bool() {bool_ = false;};
Bool(bool Val) : bool_(Val) { bool_str_ = bool_ ? L"true" : L"false"; };
const bool & get() const
{
return bool_;
};
void operator=( bool b ) {bool_ = b; bool_str_ = bool_ ? L"true" : L"false"; }
const std::wstring &string() const
{
return bool_str_ ;
}
static Bool parse(const std::wstring & Str);
private:
bool bool_;
std::wstring bool_str_;
};
std::wostream & operator << (std::wostream & _Wostream, const Bool & _val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf::Bool);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment