[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fastcgipp-users] converting data to string
From: |
ninti |
Subject: |
[Fastcgipp-users] converting data to string |
Date: |
Mon, 04 Jan 2010 16:18:11 +1030 |
I am trying to build a string which will form the body of an email sent from a
contact page. I'm trying to include the IP address and date in the email,
without
much luck so far.
These variables/methods print fine to the 'out <<' stream:
out << environment.remoteAddress;
out << boost::posix_time::second_clock::local_time();
but I cannot concatenate them into a std::string:
std::string msg = "blah" + environment.remoteAddress + "blah";
std::string date = boost::posix_time::second_clock::local_time();
std::string msg = "blah" + date + "blah";
The problem appears to be type related:
contact.cpp:52: error: conversion from ‘Fastcgipp::Http::Address’ to non-scalar
type ‘std::basic_string<char, std::char_traits<char>, std::allocator<char> >’
requested
contact.cpp:53: error: conversion from ‘boost::posix_time::ptime’ to non-scalar
type ‘std::basic_string<char, std::char_traits<char>, std::allocator<char> >’
requested
I have checked the docs and can see that environment.remoteAddress is in fact
not
string, but perhaps an array or object(?).
Is there a simple way to get string values for these two pieces of data that
can
be concatenated with other strings?
Thanks
Mike
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fastcgipp-users] converting data to string,
ninti <=