Skip to content

Commit

Permalink
Cython binding for FBString
Browse files Browse the repository at this point in the history
Summary: only exporting `toStdString` API for now, which is most useful in exposing FBString to Python land

Reviewed By: Filip-F

Differential Revision: D34402501

fbshipit-source-id: 6ebe53b346e6be037493abb712edbc301ea06ef6
  • Loading branch information
junzh0u authored and facebook-github-bot committed Feb 23, 2022
1 parent 0d3eeba commit ceff5e2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions folly/python/fbstring.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from libcpp.string cimport string

cdef extern from "folly/FBString.h" namespace "folly":
cdef cppclass basic_fbstring[T]:
string toStdString()

ctypedef basic_fbstring[char] fbstring

0 comments on commit ceff5e2

Please sign in to comment.