当前位置: 首页>>代码示例>>C++>>正文


C++ redis_key::reset方法代码示例

本文整理汇总了C++中acl::redis_key::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ redis_key::reset方法的具体用法?C++ redis_key::reset怎么用?C++ redis_key::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在acl::redis_key的用法示例。


在下文中一共展示了redis_key::reset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test_expire

static bool test_expire(acl::redis_key& option, int i)
{
	acl::string key;

	key.format("%s_%d", __keypre.c_str(), i);
	option.reset();
	if (option.expire(key.c_str(), 100) < 0)
	{
		printf("expire key: %s error\r\n", key.c_str());
		return false;
	}
	else if (i < 10)
		printf("expire ok, key: %s\r\n", key.c_str());
	return true;
}
开发者ID:2202877,项目名称:acl,代码行数:15,代码来源:redis_manager.cpp

示例2: test_type

static bool test_type(acl::redis_key& option, int i)
{
	acl::string key;

	key.format("%s_%d", __keypre.c_str(), i);
	option.reset();
	acl::redis_key_t ret = option.type(key.c_str());
	if (ret == acl::REDIS_KEY_UNKNOWN)
	{
		printf("unknown type key: %s\r\n", key.c_str());
		return false;
	}
	else if (i < 10)
		printf("type ok, key: %s, ret: %d\r\n", key.c_str(), ret);
	return true;
}
开发者ID:2202877,项目名称:acl,代码行数:16,代码来源:redis_manager.cpp

示例3: test_del

static bool test_del(acl::redis_key& option, int i)
{
	acl::string key;

	key.format("%s_%d", __keypre.c_str(), i);
	option.reset();
	int ret = option.del(key.c_str(), NULL);
	if (ret < 0)
	{
		printf("del key: %s error\r\n", key.c_str());
		return false;
	}
	else if (i < 10)
		printf("del ok, key: %s\r\n", key.c_str());
	return true;
}
开发者ID:2202877,项目名称:acl,代码行数:16,代码来源:redis_manager.cpp

示例4: test_ttl

static bool test_ttl(acl::redis_key& option, int i)
{
	acl::string key;
	int ttl;

	key.format("%s_%d", __keypre.c_str(), i);
	option.reset();
	if ((ttl = option.ttl(key.c_str())) < 0)
	{
		printf("get ttl key: %s error\r\n", key.c_str());
		return false;
	}
	else if (i < 10)
		printf("ttl ok, key: %s, ttl: %d\r\n", key.c_str(), ttl);
	return true;
}
开发者ID:2202877,项目名称:acl,代码行数:16,代码来源:redis_manager.cpp

示例5: test_exists

static bool test_exists(acl::redis_key& option, int i)
{
	acl::string key;

	key.format("%s_%d", __keypre.c_str(), i);
	option.reset();
	if (option.exists(key.c_str()) == false)
	{
		if (i < 10)
			printf("no exists key: %s\r\n", key.c_str());
	}
	else
	{
		if (i < 10)
			printf("exists key: %s\r\n", key.c_str());
	}
	return true;
}
开发者ID:2202877,项目名称:acl,代码行数:18,代码来源:redis_manager.cpp


注:本文中的acl::redis_key::reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。