Archived
This forum has been archived. Please start a new discussion on GitHub.
Unable to define string sequence
gsteele9
in Help Center
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:
============================================================
#ifndef STEELESWBU
#define STEELESWBU
#include <C:/Program Files/Ice-3.3.0/slice/Ice/BuiltinSequences.ice>
module SteeleSW
{
module BU
{
enum BUstatus
{
Succeeded,
Failed,
DirectoryNotFound,
InvalidIncludePattern,
InvalidExcludePattern,
ZipNotPossible,
EncryptNotPossible,
TargetObjInvalid,
HashObjInvalid
};
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;
};
};
};
#endif
===========================================================
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
============================================================
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:
============================================================
#ifndef STEELESWBU
#define STEELESWBU
#include <C:/Program Files/Ice-3.3.0/slice/Ice/BuiltinSequences.ice>
module SteeleSW
{
module BU
{
enum BUstatus
{
Succeeded,
Failed,
DirectoryNotFound,
InvalidIncludePattern,
InvalidExcludePattern,
ZipNotPossible,
EncryptNotPossible,
TargetObjInvalid,
HashObjInvalid
};
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;
};
};
};
#endif
===========================================================
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
============================================================
0
Comments
-
Hi,
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.
Dwayne0
