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


C++ Cookie::getName方法代码示例

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


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

示例1: assertTrue

TEST(CookieDecoderTest, testDecodingCommaSeparatedClientSideCookies) {
    String source =
        "$Version=\"1\"; session_id=\"1234\", " +
        "$Version=\"1\"; session_id=\"1111\"; $Domain=\".cracker.edu\"";

    Set<Cookie> cookies = CookieDecoder.decode(source);
    Iterator<Cookie> it = cookies.iterator();
    Cookie c;

    assertTrue(it.hasNext());
    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("session_id", c.getName());
    assertEquals("1234", c.getValue());
    assertNull(c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertNull(c.getDomain());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    assertTrue(it.hasNext());
    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("session_id", c.getName());
    assertEquals("1111", c.getValue());
    assertEquals(".cracker.edu", c.getDomain());
    assertNull(c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    assertFalse(it.hasNext());
}
开发者ID:1suming,项目名称:cetty2,代码行数:35,代码来源:CookieDecoderTest.cpp

示例2: assertEquals

TEST(CookieDecoderTest, testDecodingClientSideCookies) {
    String source = "$Version=\"1\"; " +
                    "Part_Number=\"Riding_Rocket_0023\"; $Path=\"/acme/ammo\"; " +
                    "Part_Number=\"Rocket_Launcher_0001\"; $Path=\"/acme\"";

    Set<Cookie> cookies = CookieDecoder.decode(source);
    Iterator<Cookie> it = cookies.iterator();
    Cookie c;

    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("Part_Number", c.getName());
    assertEquals("Rocket_Launcher_0001", c.getValue());
    assertEquals("/acme", c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertNull(c.getDomain());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    c = it.next();
    assertEquals(1, c.getVersion());
    assertEquals("Part_Number", c.getName());
    assertEquals("Riding_Rocket_0023", c.getValue());
    assertEquals("/acme/ammo", c.getPath());
    assertNull(c.getComment());
    assertNull(c.getCommentUrl());
    assertNull(c.getDomain());
    assertTrue(c.getPorts().isEmpty());
    assertEquals(Long.MIN_VALUE, c.getMaxAge());

    assertFalse(it.hasNext());
}
开发者ID:1suming,项目名称:cetty2,代码行数:33,代码来源:CookieDecoderTest.cpp

示例3: addCookie

	CGI* CGI::addCookie(QString strName, QString strValue, QDateTime qdtExpiration, QString strDomain, QString strPath, bool bHttpOnly, bool bSecure) {
		// Iterate over the existing new cookies
		for (int intCookie = 0; intCookie < this->mNewCookies.size(); ++intCookie) {
			// Localize the cookie
			Cookie structNewCookie = this->mNewCookies.at(intCookie);
			// Check the name
			if (structNewCookie.getName() == strName) {
				// Delete the cookie
				this->mNewCookies.removeAt(intCookie);
				// We're done
				break;
			}
		}
		// Create the new structure
		Cookie structNewCookie(strName, strValue, qdtExpiration, strDomain, strPath, bHttpOnly, bSecure);
		// Add the cookie to the instance
		this->mNewCookies.append(structNewCookie);
		// Return the instance
		return this;
	}
开发者ID:bolvarak,项目名称:HeimdallGI,代码行数:20,代码来源:CGI.cpp

示例4: escapeCookies

string CookieList::escapeCookies() const
{
	string cookie_parameter("");
	bool first = true;
	auto it = cookie_list_.cbegin();
	while(it != cookie_list_.cend())
	{
		if(first == true)
		{
			first = false;
		}
		else
		{
			cookie_parameter += ";";
		}

		Cookie cookie = (*it);
		cookie_parameter += (cookie.getName() + "=" + cookie.getValue());

		++it;
	}
	return cookie_parameter;
}
开发者ID:bosturbo,项目名称:GooglePlusLibrary,代码行数:23,代码来源:CookieList.cpp

示例5: clear

void Cookies::clear(Cookie & cookie)
{
    cookie.setValue("deleted");
    cookie.setExpires(QDateTime::fromTime_t(0));
    m_cookies[cookie.getName()] = cookie;
}
开发者ID:scheibel,项目名称:tastefulserver,代码行数:6,代码来源:Cookie.cpp

示例6: set

void Cookies::set(const Cookie & cookie)
{
    m_cookies[cookie.getName()] = cookie;
}
开发者ID:scheibel,项目名称:tastefulserver,代码行数:4,代码来源:Cookie.cpp


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