Advertisement
dudeinberlin

Untitled

Oct 27th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. //char szTestString[] = "tesing/myname_junk";
  2.     class CharacterCustomizationAsset :
  3.         public fb::Asset
  4.     {
  5.     public:
  6.         UIHudIcon m_uIHudIcon;//
  7.         fb::String m_uIKitIconName;
  8.         fb::String m_labelSid;
  9.  
  10.        
  11.         __forceinline char *GetName()
  12.         {
  13.             static char szName[20] = {0};
  14.             bool asdf = false;
  15.             bool Slash = false;
  16.  
  17.             const char *name = this->m_name.m_chars;
  18.  
  19.             if( name )
  20.             {
  21.                 for( int i = 0, j = 0; i < (int)strlen(name); i++ )
  22.                 {
  23.                     if( asdf && name[i] == '_' )
  24.                     {
  25.                         szName[j] = 0;
  26.                         break;
  27.                     }
  28.  
  29.                     if( name[i] == '/' && !asdf )
  30.                     {
  31.                         if(!Slash)
  32.                         {
  33.                             Slash = true;
  34.                             continue;
  35.                         }
  36.                         asdf = true;
  37.                         continue;
  38.                     }
  39.  
  40.                     if( asdf )
  41.                     {
  42.                         szName[j] = name[i+2];
  43.                         j++;
  44.                     }
  45.                 }
  46.             }
  47.             return szName;
  48.         }
  49.         __forceinline char* GetName1()
  50.         {
  51.             static char szName[20] = {0};
  52.             const char* name = this->m_name.m_chars;
  53.             name = strstr(name, "/") + 1;
  54.             strcpy_s(szName, 20, name);
  55.             memset(strstr(szName, "_"), 0, 1);
  56.             return (char*)szName;
  57.         }
  58.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement