Example #1
0
// ストリームの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;
}
Example #2
0
	bool operator<=(value const& other) const
	{
	    return apply_visitor(less_or_equal(),v_,other.get());
	}
Example #3
0
	bool operator<(value const& other) const
	{
	    return apply_visitor(less_than(),v_,other.get());
	}
Example #4
0
	bool operator>=(value const& other) const
	{
	    return apply_visitor(greater_or_equal(),v_,other.get());
	}
Example #5
0
	bool operator>(value const& other) const
	{
	    return apply_visitor(greater_than(),v_,other.get());
	}
Example #6
0
	bool operator!=(value const& other) const
	{
	    return !(apply_visitor(equals(),v_,other.get()));
	}
Example #7
0
 value(const value<OtherValue, OtherUnits> & v) :
 m_rep(internal::convert<OtherUnits, Units>::fn(v.get()))
 {
 }
Example #8
0
 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()));
 }
Example #9
0
 value<Value, pow<Unit, 1, 2> > sqrt(const value<Value, Unit> & a)
 {
     return value<Value, pow<Unit, 1, 2> >(std::sqrt(a.get()));
 }
Example #10
0
 value<Value, Unit > operator*(const Value & a, const value<Value, Unit> & b)
 {
     return value<Value, Unit>(a * b.get());
 }
Example #11
0
 value<Value, pow<Unit, -1 > > operator/(const Value & a, const value<Value, Unit> & b)
 {
     return value<Value, pow<Unit, -1 > >(a / b.get());
 }
Example #12
0
 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());
 }
Example #13
0
 value< Value, compose<Units, OtherUnits> >
 operator*(const value<OtherValue, OtherUnits> & other) const
 {
     return value<Value, compose<Units, OtherUnits> >(get() * other.get());
 }
Example #14
0
		T operator[](value<T> v){return v.get();}