VirtualBox

Changeset 20809 in vbox


Ignore:
Timestamp:
Jun 23, 2009 9:08:20 AM (16 years ago)
Author:
vboxsync
Message:

Runtime/getopt: new parameter value type 'UUID'

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/getopt.h

    r20374 r20809  
    8282/** The value must be a valid ethernet MAC address. */
    8383#define RTGETOPT_REQ_MACADDR                    14
     84/** The value must be a valid UUID. */
     85#define RTGETOPT_REQ_UUID                       15
    8486/** The mask of the valid required types. */
    8587#define RTGETOPT_REQ_MASK                       15
     
    158160    /** A RTGETOPT_REQ_MACADDR option argument. */
    159161    RTMAC           MacAddr;
     162    /** A RTGETOPT_REQ_UUID option argument. */
     163    RTUUID          Uuid;
    160164    /** A signed integer value. */
    161165    int64_t         i;
  • trunk/src/VBox/Runtime/common/misc/getopt.cpp

    r18744 r20809  
    3838#include <iprt/assert.h>
    3939#include <iprt/ctype.h>
     40#include <iprt/uuid.h>
    4041
    4142
     
    440441                }
    441442
     443                case RTGETOPT_REQ_UUID:
     444                {
     445                    RTUUID Uuid;
     446                    if (RTUuidFromStr(&Uuid, pszValue) != VINF_SUCCESS)
     447                        return VERR_GETOPT_INVALID_ARGUMENT_FORMAT;
     448                    pValueUnion->Uuid = Uuid;
     449                    break;
     450                }
     451
    442452                default:
    443453                    AssertMsgFailed(("i=%d f=%#x\n", pOpt - &pState->paOptions[0], pOpt->fFlags));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette