当前位置: 首页>>代码示例>>C++>>正文


C++ ACE_TString::strstr方法代码示例

本文整理汇总了C++中ACE_TString::strstr方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_TString::strstr方法的具体用法?C++ ACE_TString::strstr怎么用?C++ ACE_TString::strstr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ACE_TString的用法示例。


在下文中一共展示了ACE_TString::strstr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: dll_str


//.........这里部分代码省略.........
                  ACE_DEBUG ((LM_DEBUG,
                              ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ")
                              ACE_TEXT ("(\"%s\", 0x%x) -> %s: %s\n"),
                              name->c_str (),
                              open_mode,
                              ((this->handle_ != ACE_SHLIB_INVALID_HANDLE)
                               ? ACE_TEXT ("succeeded")
                               : ACE_TEXT ("failed")),
                              this->error()->c_str()));
                }

              if (this->handle_ != ACE_SHLIB_INVALID_HANDLE)   // Good one?
                break;

              // If errno is ENOENT we just skip over this one,
              // anything else - like an undefined symbol, for
              // instance must be flagged here or the next error will
              // mask it.
              // @TODO: If we've found our DLL _and_ it's
              // broken, should we continue at all?
              if ((errno != 0) && (errno != ENOENT) && ACE::debug ())
                ACE_ERROR ((LM_ERROR,
                            ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ")
                            ACE_TEXT ("(\'%s\') failed, errno=")
                            ACE_TEXT ("%d: %s\n"),
                            name->c_str (),
                            errno,
                            this->error ()->c_str ()));

#if defined (AIX)
              // AIX often puts the shared library file (most often named
              // shr.o) inside an archive library. If this is an archive
              // library name, then try appending [shr.o] and retry.
              if (ACE_TString::npos != name->strstr (ACE_TEXT (".a")))
                {
                  ACE_TCHAR aix_pathname[MAXPATHLEN + 1];
                  ACE_OS::strncpy (aix_pathname,
                                   name->c_str (),
                                   name->length ());
                  aix_pathname[name->length ()] = '\0';
                  ACE_OS::strcat (aix_pathname, ACE_TEXT ("(shr.o)"));
                  open_mode |= RTLD_MEMBER;

                  if (ACE::debug ())
                    {
                      ACE_DEBUG ((LM_DEBUG,
                                  ACE_TEXT ("ACE (%P|%t) DLL_Handle::open ")
                                  ACE_TEXT ("(\"%s\", 0x%x) -> %s: %s\n"),
                                  aix_pathname,
                                  open_mode,
                                  ACE_TEXT ((this->handle_ != ACE_SHLIB_INVALID_HANDLE)
                                                ? "succeeded"
                                                : "failed"),
                                  this->error()->c_str()));
                    }

                  this->handle_ = ACE_OS::dlopen (aix_pathname, open_mode);
                  if (this->handle_ != ACE_SHLIB_INVALID_HANDLE)
                    break;

                  // If errno is ENOENT we just skip over this one, anything
                  // else - like an undefined symbol, for instance
                  // must be flagged here or the next error will mask it.
                  //
                  // @TODO: If we've found our DLL _and_ it's broken,
                  // should we continue at all?
开发者ID:yuanxu,项目名称:liveshow_r2,代码行数:67,代码来源:DLL_Manager.cpp


注:本文中的ACE_TString::strstr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。