// ストリームのvalueから、ストリームタイプを得る CStreamData::TYPE CSCJsonParser::getStreamType(const value& val) const { // 形式が不正 if (!val.is<object>()){ return CStreamData::TYPE_UNKNOWN; } // タイプを文字列で取得 wxString str = val.get("type").get<string>(); if (str == "message"){ // メッセージが投稿 return CStreamData::TYPE_MESSAGE_ADD; } else if (str == "delete_subscribing"){ // チャンネルにメンバー参加 return CStreamData::TYPE_CHANNEL_MEMBER_SUB; } else if (str == "subscribing"){ // チャンネルからメンバー離脱 return CStreamData::TYPE_CHANNEL_MEMBER_ADD; } else if (str == "channel"){ // チャンネル情報更新 return CStreamData::TYPE_CHANNEL_UPDATE; } else if (str == "user"){ // ユーザ情報変更 return CStreamData::TYPE_USER_UPDATE; } // 解析できなかった return CStreamData::TYPE_UNKNOWN; }
bool operator<=(value const& other) const { return apply_visitor(less_or_equal(),v_,other.get()); }
bool operator<(value const& other) const { return apply_visitor(less_than(),v_,other.get()); }
bool operator>=(value const& other) const { return apply_visitor(greater_or_equal(),v_,other.get()); }
bool operator>(value const& other) const { return apply_visitor(greater_than(),v_,other.get()); }
bool operator!=(value const& other) const { return !(apply_visitor(equals(),v_,other.get())); }
value(const value<OtherValue, OtherUnits> & v) : m_rep(internal::convert<OtherUnits, Units>::fn(v.get())) { }
value<Value, pow<Unit, Num, Den> > raise(const value<Value, Unit> & a) { return value<Value, pow<Unit, Num, Den> >(internal::fixed_power<Num, Den>::pow(a.get())); }
value<Value, pow<Unit, 1, 2> > sqrt(const value<Value, Unit> & a) { return value<Value, pow<Unit, 1, 2> >(std::sqrt(a.get())); }
value<Value, Unit > operator*(const Value & a, const value<Value, Unit> & b) { return value<Value, Unit>(a * b.get()); }
value<Value, pow<Unit, -1 > > operator/(const Value & a, const value<Value, Unit> & b) { return value<Value, pow<Unit, -1 > >(a / b.get()); }
value< Value, compose<Units, pow<OtherUnits, -1 > > > operator/(const value<OtherValue, OtherUnits> & other) const { return value<Value, compose<Units, pow<OtherUnits, -1 > > >(get() / other.get()); }
value< Value, compose<Units, OtherUnits> > operator*(const value<OtherValue, OtherUnits> & other) const { return value<Value, compose<Units, OtherUnits> >(get() * other.get()); }
T operator[](value<T> v){return v.get();}