Exemplo n.º 1
0
nsCSSTextAttr::nsCSSTextAttr(PRUint32 aIndex, nsIContent *aRootContent,
                             nsIContent *aContent) :
  nsTextAttr<nsAutoString>(aContent == nsnull), mIndex(aIndex)
{
  mIsRootDefined = GetValueFor(aRootContent, &mRootNativeValue);

  if (aContent)
    mIsDefined = GetValueFor(aContent, &mNativeValue);
}
Exemplo n.º 2
0
nsCSSTextAttr::nsCSSTextAttr(PRUint32 aIndex, nsIDOMElement *aRootElm,
                             nsIDOMElement *aElm) :
  nsTextAttr<nsAutoString>(aElm == nsnull), mIndex(aIndex)
{
  mIsRootDefined = GetValueFor(aRootElm, &mRootNativeValue);

  if (aElm)
    mIsDefined = GetValueFor(aElm, &mNativeValue);
}
Exemplo n.º 3
0
bool
RelayConfigs::GetValueFor( const char* key, vector<int>& ints )
{
    char str[256];
    bool found = GetValueFor( key, str, sizeof(str) );
    int len = strlen(str);
    char buf[len+1];
    strcpy( buf, str );
    char* port = buf;

    for ( ; ; ) {
        char* end = strstr( port, "," );
        if ( !!end ) {
            *end = '\0';
        }

        fprintf( stderr, "adding %s to ports\n", port );
        ints.push_back( atoi(port) );

        if ( !end ) {
            break;
        }
        port = end + 1;
    }


    return found;
}
Exemplo n.º 4
0
bool
RelayConfigs::GetValueFor( const char* key, time_t* value )
{
    int val;
    bool success = GetValueFor( key, &val );
    if ( success ) {
        *value = val;
    }
    return success;
}
Exemplo n.º 5
0
bool
RelayConfigs::GetValueFor( const char* key, int* value )
{
    char buf[32];
    bool found = GetValueFor( key, buf, sizeof(buf) );
    if ( found ) {
        *value = atoi( buf );
    }
    return found;
}