Home Comments

Identity Constructor

acbellacbell Member Andrew BellOrganization: Iowa State UniversityProject: National Resources Inventory ✭✭

I'd like to see a ctor for Ice::Identity that just takes a couple of strings. I know that there is stringToIdentity(), but it has to do a bunch of parsing for a '/' to separate the components and look for escaped characters.

If this isn't good for some reason, how about a version of stringToIdentity() that takes two arguments (one for category and one for name) to avoid the trouble of assembling the special string with a "/" in it, only to have it ripped apart again by the utility function.

I'd be happy to submit as a patch.

-- Andrew Bell
[email protected]


  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    In the next Ice release, classes and exceptions will have a "one-shot" constructor to initialize all their members. We did not add such a constructor for structs (such as Ice::Identity) because we want to keep simple structs POD.

    You can use the aggregate-initialization syntax to initialize Ice-generated structs, for example:
    Ice::Identity id = {"foo", "bar"};

Sign In or Register to comment.