Home Help Center

Unable to define string sequence

gsteele9gsteele9 Member Greg SteeleOrganization: RetiredProject: Backup System
I'm sure this is something obvious that I'm not seeing, but I don't seem to be able to define a string sequence in my .ice file. Any help would be much appreciated.

I tried defining my sequence and got a "syntax error" on it, then I tried to use the builtin definition and got an "undefined" on that, even though I included the BuiltInSequences.ice file. Here is my current .ice file with one string sequence (includePatterns) that generates the syntax error and one (excludePatterns) that generates the undefined error:


#include <C:/Program Files/Ice-3.3.0/slice/Ice/BuiltinSequences.ice>

module SteeleSW
module BU
enum BUstatus

struct Backup
string sourceDir; //Root dir for backup
sequence<string> includePatterns; //Regex's for files that ARE backed up
StringSeq excludePatterns; //Regex's for files that are NOT backed up
bool zipForXmit; //TRUE if data is zipped for transmission
bool encryptSession; //TRUE if session is encrypted
string targetObjID; //Object that receives backup blocks
string hashObjID; //Object that sends block hashes

interface IBUSource
BUstatus execute();
BUstatus cancel();

class BUSource implements IBUSource
Backup BU;



Here is the execution of slice2jave:
C:\Documents and Settings\Greg>slice2java --output-dir "C:\Documents and Settings\Greg\My Documents\EclipseWorkspace\BU\src" -I"C:\Program Files\Ice-3.3.0\slice\Ice" --meta java:java5 "C:\Documents and Settings\Greg\My Documents\EclipseWorkspace\BU\BU.ice"
C:/Documents and Settings/Greg/My Documents/EclipseWorkspace/BU/BU.ice:32: syntax error
C:/Documents and Settings/Greg/My Documents/EclipseWorkspace/BU/BU.ice:33: `StringSeq' is not defined


  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    Hmmm... I can't test this right now because I don't have a Windows machine handy. But I suspect the problem is that you should be using Ice::StringSeq, not StringSeq.


  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine

    You can't define the sequence type inside of the struct definition, it needs to be done separately.
    module A
    sequence<string> StringSeq;
    struct B
        StringSeq ss;

    If you want to use the Ice builtin type instead then you need to use Ice::StringSeq instead of just StringSeq.

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    Ah, me bad--I slipped to the line below.

    Yes, Dwayne is right, of course: you can't define a sequence inside a struct. But StringSeq shouldn't compile either, unless you call it Ice::StringSeq.


  • gsteele9gsteele9 Member Greg SteeleOrganization: RetiredProject: Backup System
    Problem resolved. Thanks a lot.

    Thanks for all the quick help. The responses cleared up both questions.
Sign In or Register to comment.