Repository: xbmc/xbmc
File: xbmc/filesystem/StackDirectory.cpp (C++)

Code before:
{
  CStackDirectory::CStackDirectory() = default;

  CStackDirectory::~CStackDirectory() = default;

  bool CStackDirectory::GetDirectory(const CURL& url, CFileItemList& items)
  {
    items.Clear();
    std::vector<std::string> files;
    const std::string pathToUrl(url.Get());
    if (!GetPaths(pathToUrl, files))
      return false;   // error in path

    for (const std::string& i : files)
    {
      CFileItemPtr item(new CFileItem(i));
      item->SetPath(i);
      item->SetFolder(false);
      items.Add(item);
    }
    return true;
  }

  std::string CStackDirectory::GetStackedTitlePath(const std::string &strPath)
  {
    VECCREGEXP RegExps =
        CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoStackRegExps;
    return GetStackedTitlePath(strPath, RegExps);
  }

  std::string CStackDirectory::GetStackedTitlePath(const std::string &strPath, VECCREGEXP& RegExps)
  {
    CStackDirectory stack;
    CFileItemList   files;
    std::string      strStackTitlePath,
                    strCommonDir        = URIUtils::GetParentPath(strPath);

    const CURL pathToUrl(strPath);
    stack.GetDirectory(pathToUrl, files);

    if (files.Size() > 1)
    {
      std::string strStackTitle;

      std::string File1 = URIUtils::GetFileName(files[0]->GetPath());
      std::string File2 = URIUtils::GetFileName(files[1]->GetPath());
      // Check if source path uses URL encoding
      if (URIUtils::HasEncodedFilename(CURL(strCommonDir)))
      {
        File1 = CURL::Decode(File1);
        File2 = CURL::Decode(File2);

Review comment (suggestion):
Use the real type instead of the legacy typedefs: `std::vector<CRegExp>`. Here and in all other instances for newly added or changed code

Code after:
{
  CStackDirectory::CStackDirectory() = default;

  CStackDirectory::~CStackDirectory() = default;

  bool CStackDirectory::GetDirectory(const CURL& url, CFileItemList& items)
  {
    items.Clear();
    std::vector<std::string> files;
    const std::string pathToUrl(url.Get());
    if (!GetPaths(pathToUrl, files))
      return false;   // error in path

    for (const std::string& i : files)
    {
      CFileItemPtr item(new CFileItem(i));
      item->SetPath(i);
      item->SetFolder(false);
      items.Add(item);
    }
    return true;
  }

  std::string CStackDirectory::GetStackedTitlePath(const std::string& strPath)
  {
    std::vector<CRegExp> RegExps =
        CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_videoStackRegExps;
    return GetStackedTitlePath(strPath, RegExps);
  }

  std::string CStackDirectory::GetStackedTitlePath(const std::string& strPath,
                                                   std::vector<CRegExp>& RegExps)
  {
    CStackDirectory stack;
    CFileItemList   files;
    std::string      strStackTitlePath,
                    strCommonDir        = URIUtils::GetParentPath(strPath);

    const CURL pathToUrl(strPath);
    stack.GetDirectory(pathToUrl, files);

    if (files.Size() > 1)
    {
      std::string strStackTitle;

      std::string File1 = URIUtils::GetFileName(files[0]->GetPath());
      std::string File2 = URIUtils::GetFileName(files[1]->GetPath());
      // Check if source path uses URL encoding
      if (URIUtils::HasEncodedFilename(CURL(strCommonDir)))
      {
        File1 = CURL::Decode(File1);