VirtualBox

Changeset 94347 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Mar 24, 2022 8:13:03 AM (3 years ago)
Author:
vboxsync
Message:

Main/Unattended: ​​bugref:9781. Extending GeneralTextScript with the functionality to append a new line.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/TextScript.cpp

    r93115 r94347  
    194194HRESULT GeneralTextScript::parse()
    195195{
    196 //  AssertReturn(!mfDataParsed, mpSetError->setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("parse called more than once")));
     196    AssertReturn(!mfDataParsed, mpSetError->setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("parse called more than once")));
    197197
    198198    /*
     
    363363}
    364364
     365HRESULT GeneralTextScript::appendLine(const Utf8Str &rStrLineToAppend)
     366{
     367    AssertReturn(mfDataParsed, mpSetError->setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("appendLine() called before parse()")));
     368
     369    try
     370    {
     371        mScriptContentByLines.append(rStrLineToAppend);
     372    }
     373    catch (std::bad_alloc &)
     374    {
     375        return E_OUTOFMEMORY;
     376    }
     377    return S_OK;
     378
     379}
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