Results 1 to 2 of 2

Thread: std::string in interface

  1. #1
    dthompson is offline Registered User
    Name: Don Thompson
    Organization: Digital Federal Credit Union
    Project: credit card fraud monitoring
    Join Date
    Aug 2005
    Location
    south shore mass
    Posts
    10

    std::string in interface

    Hi,
    I have numerous interfaces which use sequence of records which contains string fields.
    They have all worked for months, and now I wrote another which delivers garbage back to the client. It seems to have valid data misalligned, with a few low value bytes sprinkled in.
    I have added clean database data to make sure it's not a database record problem. The data fields of the record on the server side are clean just before being pushed onto the vector.

    I was reading a recient message here -- Casting char* to std::string which refers to using sequence<byte> to handle string data. My assumption in reading this was that it refered to cases where binary data might be contained in the string. Am I correct in that string data with text data should be handled properly in interface definitions?

    I am seeing this error from a PHP client, which receives an array of records which contains string fields.
    Don Thompson
    Digital Federal Credit Union
    www.dcu.org
    Ice Project: credit union core processing prototype which may expand to open source project.
    Current Environment:
    Debian Linux Sarge,
    mysql 4.1.11-Debian,
    mysql++ v 2.1.0.beta1,
    qt3 v 3.3.4,
    Ice-3.0.1
    IcePHP-3.0.1
    Server: c++ using mysql++ to access mysql db, with Ice interfaces.
    Desktop Client: c++ using qt3, Ice interfaces to Server
    Home Banking Client: Python using IcePy interface to Server
    Currently using PHP Client

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi Don,

    It would really help us to see an example of what your application is doing, such as the Slice types involved and some sample PHP code. Do the strings that you're transmitting use plain ASCII?

    You are correct in that you should use strings to handle text data, and sequence<byte> to handle binary blobs.

    As always, we also need to know the exact versions of Ice, PHP, operating system and compiler. Some users put this information in their signature, which is handy for us.

    Take care,
    - Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. session using std::wstring instead of std::string
    By Andrew in forum Help Center
    Replies: 2
    Last Post: 01-23-2008, 08:06 AM
  2. slice2freeze std::wstring
    By paolo in forum Bug Reports
    Replies: 4
    Last Post: 01-16-2008, 07:03 AM
  3. Casting char* to std::string
    By inmmat in forum Help Center
    Replies: 5
    Last Post: 06-10-2006, 01:43 PM
  4. problem in mapping string->string[] in C#
    By teayu in forum Help Center
    Replies: 2
    Last Post: 10-26-2004, 11:12 PM
  5. non-std scandir function
    By marlowa in forum Patches
    Replies: 1
    Last Post: 02-28-2003, 01:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •