VirtualBox

Changeset 87578 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Feb 3, 2021 3:43:22 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142606
Message:

Main: Doxygen v1.8.20 seems to get confused by appendTokenizedStrings and dumpHostDnsStrVector prototypes and unable to match them to definitions, so just move the definitions up to the top and drop the prototypes.

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostDnsService.cpp

    r85271 r87578  
    3636
    3737
    38 static void dumpHostDnsInformation(const HostDnsInformation&);
    39 static void dumpHostDnsStrVector(const std::string &prefix, const std::vector<std::string> &v);
    40 
     38
     39static void dumpHostDnsStrVector(const std::string &prefix, const std::vector<std::string> &v)
     40{
     41    int i = 1;
     42    for (std::vector<std::string>::const_iterator it = v.begin();
     43         it != v.end();
     44         ++it, ++i)
     45        LogRel(("  %s %d: %s\n", prefix.c_str(), i, it->c_str()));
     46    if (v.empty())
     47        LogRel(("  no %s entries\n", prefix.c_str()));
     48}
     49
     50static void dumpHostDnsInformation(const HostDnsInformation &info)
     51{
     52    dumpHostDnsStrVector("server", info.servers);
     53
     54    if (!info.domain.empty())
     55        LogRel(("  domain: %s\n", info.domain.c_str()));
     56    else
     57        LogRel(("  no domain set\n"));
     58
     59    dumpHostDnsStrVector("search string", info.searchList);
     60}
    4161
    4262bool HostDnsInformation::equals(const HostDnsInformation &info, uint32_t fLaxComparison) const
     
    4464    bool fSameServers;
    4565    if ((fLaxComparison & IGNORE_SERVER_ORDER) == 0)
    46     {
    4766        fSameServers = (servers == info.servers);
    48     }
    4967    else
    5068    {
     
    6280    }
    6381    else
    64     {
    6582        fSameDomain = fSameSearchList = true;
    66     }
    6783
    6884    return fSameServers && fSameDomain && fSameSearchList;
     
    413429}
    414430
    415 static void dumpHostDnsInformation(const HostDnsInformation &info)
    416 {
    417     dumpHostDnsStrVector("server", info.servers);
    418 
    419     if (!info.domain.empty())
    420         LogRel(("  domain: %s\n", info.domain.c_str()));
    421     else
    422         LogRel(("  no domain set\n"));
    423 
    424     dumpHostDnsStrVector("search string", info.searchList);
    425 }
    426 
    427 
    428 static void dumpHostDnsStrVector(const std::string &prefix, const std::vector<std::string> &v)
    429 {
    430     int i = 1;
    431     for (std::vector<std::string>::const_iterator it = v.begin();
    432          it != v.end();
    433          ++it, ++i)
    434         LogRel(("  %s %d: %s\n", prefix.c_str(), i, it->c_str()));
    435     if (v.empty())
    436         LogRel(("  no %s entries\n", prefix.c_str()));
    437 }
  • trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp

    r83794 r87578  
    4242#include <vector>
    4343
    44 static inline int registerNotification(const HKEY& hKey, HANDLE& hEvent);
    45 static void appendTokenizedStrings(std::vector<std::string> &vecStrings, const std::string &strToAppend, char chDelim = ' ');
     44
     45DECLINLINE(int) registerNotification(const HKEY &hKey, HANDLE &hEvent)
     46{
     47    LONG lrc = RegNotifyChangeKeyValue(hKey,
     48                                       TRUE,
     49                                       REG_NOTIFY_CHANGE_LAST_SET,
     50                                       hEvent,
     51                                       TRUE);
     52    AssertMsgReturn(lrc == ERROR_SUCCESS,
     53                    ("Failed to register event on the key. Please debug me!"),
     54                    VERR_INTERNAL_ERROR);
     55
     56    return VINF_SUCCESS;
     57}
     58
     59static void appendTokenizedStrings(std::vector<std::string> &vecStrings, const std::string &strToAppend, char chDelim /* = ' ' */)
     60{
     61    if (strToAppend.empty())
     62        return;
     63
     64    std::istringstream stream(strToAppend);
     65    std::string substr;
     66
     67    while (std::getline(stream, substr, chDelim))
     68    {
     69        if (substr.empty())
     70            continue;
     71
     72        if (std::find(vecStrings.cbegin(), vecStrings.cend(), substr) != vecStrings.cend())
     73            continue;
     74
     75        vecStrings.push_back(substr);
     76    }
     77}
     78
    4679
    4780struct HostDnsServiceWin::Data
     
    444477}
    445478
    446 static inline int registerNotification(const HKEY& hKey, HANDLE& hEvent)
    447 {
    448     LONG lrc = RegNotifyChangeKeyValue(hKey,
    449                                        TRUE,
    450                                        REG_NOTIFY_CHANGE_LAST_SET,
    451                                        hEvent,
    452                                        TRUE);
    453     AssertMsgReturn(lrc == ERROR_SUCCESS,
    454                     ("Failed to register event on the key. Please debug me!"),
    455                     VERR_INTERNAL_ERROR);
    456 
    457     return VINF_SUCCESS;
    458 }
    459 
    460 static void appendTokenizedStrings(std::vector<std::string> &vecStrings, const std::string &strToAppend, char chDelim /* = ' ' */)
    461 {
    462     if (strToAppend.empty())
    463         return;
    464 
    465     std::istringstream stream(strToAppend);
    466     std::string substr;
    467 
    468     while (std::getline(stream, substr, chDelim))
    469     {
    470         if (substr.empty())
    471             continue;
    472 
    473         if (std::find(vecStrings.cbegin(), vecStrings.cend(), substr) != vecStrings.cend())
    474             continue;
    475 
    476         vecStrings.push_back(substr);
    477     }
    478 }
    479 
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