コード例 #1
0
ファイル: session_interface.cpp プロジェクト: klupek/cppcms
void session_interface::load_data(data_type &data,std::string const &s)
{
	data.clear();
	char const *begin=s.data(),*end=begin+s.size();
	while(begin < end) {
		packed p(begin,end);
		begin +=sizeof(p);
		if(end - begin >= int(p.key_size + p.data_size)) {
			string key(begin,begin+p.key_size);
			begin+=p.key_size;
			string val(begin,begin+p.data_size);
			begin+=p.data_size;
			entry &ent=data[key];
			ent.exposed = p.exposed;
			ent.value.swap(val);
		}
		else {
			throw cppcms_error("sessions::format violation data");
		}

	}

}
コード例 #2
0
 /** @brief Remove all elements from the vector leaving the
     *          partition_vector with size 0.
     */
 void clear()
 {
     partition_vector_.clear();
 }
コード例 #3
0
 void initialize(size_t s, const char* name)
 {
   _data.clear();
   this->reserve(s);
   _outgoing<<'{'<<"jsonrpc"<<':'<<"2.0"<<','<<"method"<<':'<<name<<','<<"params"<<':';
 }
コード例 #4
0
 void initialize(size_t s)
 {
   _data.clear();
   this->reserve(s);
   _outgoing<<'{'<<"jsonrpc"<<':'<<"2.0"<<','<<"result"<<':';
 }
コード例 #5
0
 void clear(T&)
 {
   _data.clear();
 }
コード例 #6
0
 /// Remove all elements from the vector leaving the
 /// partitioned_vector_partition with size 0.
 ///
 void clear()
 {
     partitioned_vector_partition_.clear();
 }
コード例 #7
0
 /// Remove all elements from the vector leaving the
 /// partition_unordered_map with size 0.
 ///
 void clear()
 {
     partition_unordered_map_.clear();
 }