};
}
+#define THROW_IK_EXCEPTION(text) \
+{ \
+ std::ostringstream oss; oss << text; \
+ throw INTERP_KERNEL::Exception(oss.str()); \
+}
+
#endif
}
}
+/*!
+ * Split \a st string into chunks of sz characters each.
+ * Size of input \a st must a be a multiple of \a sz. If not an exception is thrown.
+ */
+std::vector<std::string> DataArray::SplitStringInChuncks(const std::string st, std::size_t sz)
+{
+ std::size_t len = st.length();
+ std::size_t nbOfCompo(len/sz);
+ if( nbOfCompo*sz != len)
+ {
+ THROW_IK_EXCEPTION("DataArray::SplitStringInChuncks : Length of input string (" << len << ") is not equal to " << nbOfCompo << "*" << sz << " !");
+ }
+ std::vector<std::string> ret(nbOfCompo);
+ for(std::size_t i = 0 ; i < nbOfCompo ; ++i)
+ {
+ std::string part = st.substr(i*sz,sz);
+ std::size_t p3=part.find_last_not_of(" \t");
+ part = part.substr(0,p3+1);
+ ret[i] = part;
+ }
+ return ret;
+}
+
/*!
* Returns the var part of the full component information.
* For example, if \a info == "SIGXY [N/m^2]", then this method returns "SIGXY".
static mcIdType GetNumberOfItemGivenBES(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg);
static mcIdType GetNumberOfItemGivenBESRelative(mcIdType begin, mcIdType end, mcIdType step, const std::string& msg);
static mcIdType GetPosOfItemGivenBESRelativeNoThrow(mcIdType value, mcIdType begin, mcIdType end, mcIdType step);
+ static std::vector<std::string> SplitStringInChuncks(const std::string st, std::size_t sz);
static std::string GetVarNameFromInfo(const std::string& info);
static std::string GetUnitFromInfo(const std::string& info);
static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit);
# include <vector>
#include <cstring>
-
-
-#define THROW_IK_EXCEPTION(text) \
-{ \
- std::ostringstream oss; oss << text; \
- throw INTERP_KERNEL::Exception(oss.str().c_str()); \
-}
-
namespace MeshFormat
{
bool isMeshExtensionCorrect( const std::string& fileName );
#include <string>
#include <sstream>
-#define THROW_IK_EXCEPTION(text) \
- { \
- std::ostringstream oss; oss << text; \
- throw INTERP_KERNEL::Exception(oss.str().c_str()); \
- }
-
namespace SauvUtilities
{
INTERP_KERNEL::NormalizedCellType MEDLOADER_EXPORT gibi2medGeom( size_t gibiType );