Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    maxon::String in classic API

    Cinema 4D SDK
    3
    6
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C4DSC
      C4DS
      last edited by C4DS

      While converting a plugin to R20 I was replacing all String occurrences with maxon::String.
      However, I encountered some issue when compiling.
      Maybe I am just not understanding the conversion process correctly?
      As such, I didn't add tags for "bug report", "issue", "API" ... feel free to add the required once.

      As far as I am aware I am still using the classic API for most of the plugin structure, but am using the MAXON API for the new datastructures.
      maxon::BasseArray::Append, for instance, requires the use of the new error system, etc ...

      According to

      Using new Data Types
      
      The MAXON API introduces new data types and replaces or extends classic data types:
      
          The new maxon::String class is the base class of the classic String class. To declare a string literal as a maxon::String one can use the "_s" qualifier. The classic API has been refactured to use maxon::String wherever possible. ...
      
      

      From reading the last sentence, I was assuming converting to maxon::String was the way to go.
      However, the SNHookClass (and thus derived classes) still seem to work with the legacy String

      0_1545139739941_maxonstring snhookclass.png

      Should I refrain from using maxon::String here and use the legacy String instead?

      1 Reply Last reply Reply Quote 0
      • O
        Ogers
        last edited by Ogers

        You probably have declared the String as const String& instead of const maxon::String& in the parent class SNHookClass.
        Hope it helped you.

        1 Reply Last reply Reply Quote 0
        • C4DSC
          C4DS
          last edited by

          Well, that is what I mean.
          The documentation says the classic API has been refactored, but the SNHookClass apparently isn't.

          1 Reply Last reply Reply Quote 0
          • O
            Ogers
            last edited by

            Well I guess that is because the cinema.framework still contains the classic c4d API as mentioned on the Maxon documentation.

            1 Reply Last reply Reply Quote 0
            • S
              s_bach
              last edited by

              Hello,

              if you implement a function of a sub-class, the function signature must match the function declaration in the base class. So if the base class is using String, you must use String in your implementation.

              As the documentation says, maxon::String was used wherever possible. Not everywhere.

              best wishes,
              Sebastian

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • C4DSC
                C4DS
                last edited by

                Thanks for the confirmation SNHookClass still using the legacy String.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post