Unable to use the function uriUnescape in string.h by passing 2 arguments

105 views
Skip to first unread message

Yash Khandelwal

unread,
Mar 2, 2022, 9:56:16 AM3/2/22
to Folly: the Facebook Open-source LibrarY
If I am using uriUnescape using 3 arguments its working fine but when i uses its overloaded function i.e. by passing 2 arguments i am getting the out.resize kind of error
Is this is the issue because of folly using String(which they made) or  anything wrong i am doing

////this works fine
UriEscapeMode mode = UriEscapeMode::ALL;
string s = "a%0D%0Ab%0D%0Ac%0D%0Ad";
 StringPiece pc(s);
string xyz;
uriUnescape(pc ,xyz,mode);
 cout<<xyz<<endl;
// this throws error
UriEscapeMode mode = UriEscapeMode::ALL;
string s = "a%0D%0Ab%0D%0Ac%0D%0Ad";
 StringPiece pc(s);
string xyz =uriUnescape(pc ,mode);
 cout<<xyz<<endl;

error is :::
/usr/local/include/folly/String-inl.h:203:7: error: request for member ‘reserve’ in ‘out’, which is of non-class type ‘folly::UriEscapeMode’      
  203 |   out.reserve(out.size() + str.size());
      |   ~~~~^~~~~~~
/usr/local/include/folly/String-inl.h:203:19: error: request for member ‘size’ in ‘out’, which is of non-class type ‘folly::UriEscapeMode’        
  203 |   out.reserve(out.size() + str.size());
      |               ~~~~^~~~
/usr/local/include/folly/String-inl.h:222:13: error: request for member ‘append’ in ‘out’, which is of non-class type ‘folly::UriEscapeMode’      
  222 |         out.append(&*last, size_t(p - last));
      |         ~~~~^~~~~~
/usr/local/include/folly/String-inl.h:223:13: error: request for member ‘push_back’ in ‘out’, which is of non-class type ‘folly::UriEscapeMode’  
  223 |         out.push_back((h1 << 4) | h2);
      |         ~~~~^~~~~~~~~
/usr/local/include/folly/String-inl.h:230:15: error: request for member ‘append’ in ‘out’, which is of non-class type ‘folly::UriEscapeMode’      
  230 |           out.append(&*last, size_t(p - last));
      |           ~~~~^~~~~~
/usr/local/include/folly/String-inl.h:231:15: error: request for member ‘push_back’ in ‘out’, which is of non-class type ‘folly::UriEscapeMode’  
  231 |           out.push_back(' ');
      |           ~~~~^~~~~~~~~
/usr/local/include/folly/String-inl.h:243:7: error: request for member ‘append’ in ‘out’, which is of non-class type ‘folly::UriEscapeMode’      
  243 |   out.append(&*last, size_t(p - last));
Reply all
Reply to author
Forward
0 new messages