Home Help Center

Support flags in slice

PapayPapay Member Dmitriy EvsyukovOrganization: AigrindProject: Best MMORPG
In the slice can be define enum by keyword enum. But how to define a slice flags? Do you do planned support flags in next version Ice?

Comments

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    You can map your flags to Slice constants
  • PapayPapay Member Dmitriy EvsyukovOrganization: AigrindProject: Best MMORPG
    How to define Flags in Slice

    Thank you for your answer, but your solution is not suitable for my purposes.
    I found the solution on their own.

    In version 3.6 it was possible to add attributes to the slice:
    ["cs:attribute:System.Flags"]
    enum MyTestFlag 
    {
        First,
        Second,
        Third
    };
    
    Then I get what I need:
    [System.Flags]
    [_System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.6b")]
    public enum MyTestFlag
    {
        First,
        Second,
        Third
    }
    
Sign In or Register to comment.