Ignore:
Timestamp:
06/20/20 01:02:20 (4 years ago)
Author:
Maciej Komosinski
Message:

Improved error messages (display longer names of the relevant object and field when available)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/param.h

    r805 r950  
    7272
    7373        virtual const char* getName() = 0;
     74        virtual const char* getLongName() { return getName(); }
    7475        virtual const char* getDescription() { return 0; }
    7576        virtual ParamEntry *getParamTab() const { return NULL; }
     
    193194        virtual void sanityCheck(int i) {}
    194195#endif
     196        SString nameDotProperty(int prop);
     197        SString nameDotPropertyForMessages(int prop);
    195198};
    196199
     
    257260        virtual void *getTarget(int i);
    258261        const char* myname;
     262        const char* mylongname;
    259263        bool dontcheckchanges;
    260264
     
    263267
    264268        const char* getName() { return myname; }
     269        const char* getLongName() { return mylongname ? mylongname : myname; }
     270
    265271        void setName(const char* n) { myname = n; }
     272        void setLongName(const char* n) { mylongname = n; }
    266273
    267274        /**
     
    270277                @param n Param's name
    271278                */
    272         SimpleAbstractParam(void* o = 0, const char*n = 0) :myname(n), dontcheckchanges(0), object(o) {}
     279        SimpleAbstractParam(void* o = 0, const char*n = 0) :myname(n), mylongname(NULL), dontcheckchanges(0), object(o) {}
    273280        void setDontCheckChanges(bool x) { dontcheckchanges = x; }
    274281
     
    330337
    331338        const char* getDescription() { return tab[0].type; }
     339        const char* getLongName() { return tab[0].help ? tab[0].help : SimpleAbstractParam::getLongName(); }
    332340
    333341        int getGroupCount() { return tab[0].group; }
Note: See TracChangeset for help on using the changeset viewer.